Skip to content

Commit

Permalink
nfsd4: fix memory leak in nfsd4_encode_fattr()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Yan, Zheng authored and J. Bruce Fields committed Mar 31, 2014
1 parent 3064639 commit 18df11d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2500,8 +2500,10 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
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);
Expand Down

0 comments on commit 18df11d

Please sign in to comment.