aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@citi.umich.edu>2009-09-04 11:59:32 -0400
committerJ. Bruce Fields <bfields@citi.umich.edu>2009-09-04 11:59:32 -0400
commit1be10a88cac5e589cdd2bcb0cf6a13ed30bcc233 (patch)
tree2d4b7fe5a1d45162d38388206772644486cd1328 /fs/nfsd
parent2671a4bf3516757ca028c139a7902a50f2bd994a (diff)
downloadkernel_samsung_tuna-1be10a88cac5e589cdd2bcb0cf6a13ed30bcc233.zip
kernel_samsung_tuna-1be10a88cac5e589cdd2bcb0cf6a13ed30bcc233.tar.gz
kernel_samsung_tuna-1be10a88cac5e589cdd2bcb0cf6a13ed30bcc233.tar.bz2
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 <bfields@citi.umich.edu>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfsfh.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index bce0b2b..01965b2 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;