linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nfsd4: fix memory leak in nfsd4_encode_fattr()
@ 2014-03-10  4:52 Yan, Zheng
  2014-03-10  8:04 ` Christoph Hellwig
  2014-03-31 21:11 ` J. Bruce Fields
  0 siblings, 2 replies; 4+ messages in thread
From: Yan, Zheng @ 2014-03-10  4:52 UTC (permalink / raw)
  To: linux-nfs; +Cc: bfields, Yan, Zheng

fh_put() does not free the temporary file handle.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
---
 fs/nfsd/nfs4xdr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 63f2395..8de4c9d 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2499,8 +2499,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);
-- 
1.8.5.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-03-31 21:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-10  4:52 [PATCH] nfsd4: fix memory leak in nfsd4_encode_fattr() Yan, Zheng
2014-03-10  8:04 ` Christoph Hellwig
2014-03-10  8:29   ` Yan, Zheng
2014-03-31 21:11 ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).