aboutsummaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorYan, Zheng <zheng.z.yan@intel.com>2014-03-10 12:52:07 +0800
committerShow Liu <show.liu@linaro.org>2014-06-18 11:40:31 +0800
commitf529f98871be1502cc4eb6ad2e31caf6770534b5 (patch)
treed94e474639d45dffb216b0ba69e9cc01f6f1b45a /fs
parent1fc6f1aefe3ee92b1c47cc7ce3aaa8b9ccc795c9 (diff)
nfsd4: fix memory leak in nfsd4_encode_fattr()
commit 18df11d0eacf67bbcd8dda755b568bbbd7264735 upstream. fh_put() does not free the temporary file handle. Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4xdr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index d21435976a0..16e8fa71eb8 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2501,8 +2501,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);