From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: "Yan, Zheng" , "J. Bruce Fields" , Kamal Mostafa Subject: [PATCH 3.8 110/133] nfsd4: fix memory leak in nfsd4_encode_fattr() Date: Tue, 22 Apr 2014 13:14:08 -0700 Message-Id: <1398197671-12786-111-git-send-email-kamal@canonical.com> In-Reply-To: <1398197671-12786-1-git-send-email-kamal@canonical.com> References: <1398197671-12786-1-git-send-email-kamal@canonical.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.8.13.22 -stable review patch. If anyone has any objections, please let me know. ------------------ From: "Yan, Zheng" commit 18df11d0eacf67bbcd8dda755b568bbbd7264735 upstream. fh_put() does not free the temporary file handle. Signed-off-by: Yan, Zheng Signed-off-by: J. Bruce Fields [ kamal: backport to 3.8 (context) ] Signed-off-by: Kamal Mostafa --- 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 dc12d02..1418028 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2430,8 +2430,10 @@ out_acl: out: kfree(acl); - if (fhp == &tempfh) + if (fhp == &tempfh) { fh_put(&tempfh); + kfree(tempfh); + } return status; out_nfserr: status = nfserrno(err); -- 1.9.1