From: J. Bruce Fields Date: Fri, 4 Sep 2009 15:59:32 +0000 (-0400) Subject: nfsd4: filehandle leak or error exit from fh_compose() X-Git-Tag: MMI-PSA29.97-13-9~26685^2~25 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1be10a88cac5e589cdd2bcb0cf6a13ed30bcc233;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git nfsd4: filehandle leak or error exit from fh_compose() A number of callers (nfsd4_encode_fattr(), at least) don't bother to release the filehandle returned to fh_compose() if fh_compose() returns an error. So, modify fh_compose() to release the filehandle before returning an error. Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index bce0b2bfbc61..01965b2f3a76 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -557,8 +557,10 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, if (inode) _fh_update(fhp, exp, dentry); - if (fhp->fh_handle.fh_fileid_type == 255) + if (fhp->fh_handle.fh_fileid_type == 255) { + fh_put(fhp); return nfserr_opnotsupp; + } } return 0;