]> git.karo-electronics.de Git - linux-beck.git/commitdiff
nfsd4: fix memory leak in nfsd4_encode_fattr()
authorYan, Zheng <zheng.z.yan@intel.com>
Mon, 10 Mar 2014 04:52:07 +0000 (12:52 +0800)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 31 Mar 2014 21:08:23 +0000 (17:08 -0400)
fh_put() does not free the temporary file handle.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4xdr.c

index 4c247c1ea5c122fe73199f44645b52f952b467d7..2723c1badd01276f9c1802d6cac210aa40f8f0a3 100644 (file)
@@ -2500,8 +2500,10 @@ out:
                security_release_secctx(context, contextlen);
 #endif /* CONFIG_NFSD_V4_SECURITY_LABEL */
        kfree(acl);
-       if (tempfh)
+       if (tempfh) {
                fh_put(tempfh);
+               kfree(tempfh);
+       }
        return status;
 out_nfserr:
        status = nfserrno(err);