]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
pNFS/flexfiles: missing error code in ff_layout_alloc_lseg()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 19 May 2017 21:31:12 +0000 (00:31 +0300)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 24 May 2017 11:52:54 +0000 (07:52 -0400)
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")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/flexfilelayout/flexfilelayout.c

index f5714ee01000de49c5efcd3675226a3a3b7a7074..23542dc44a25c9f398b8a2a69905bf9eafbe5270 100644 (file)
@@ -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;