Skip to contentSkip to conversation

pNFS/flexfiles: missing error code in ff_layout_alloc_lseg()

PATCH New Dan Carpenter 1 participant 1 message May 19, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pNFS/flexfiles: missing error code in ff_layout_alloc_lseg()

If xdr_inline_decode() fails then we end up returning ERR_PTR(0). The caller treats NULL returns as -ENOMEM so it doesn't really hurt runtime, but obviously we intended to set an error code here.

Fixes d67ae825a59d ("pnfs/flexfiles: Add the FlexFile Layout Driver")
fs/nfs/flexfilelayout/flexfilelayout.c +1 -0
index f5714ee01000..23542dc44a25 100644
@@ -454,6 +454,7 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
 			goto out_err_free;
 
 		/* fh */
+		rc = -EIO;
 		p = xdr_inline_decode(&stream, 4);
 		if (!p)
 			goto out_err_free;