summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <error27@gmail.com>2010-10-27 23:19:04 +0200
committerJ. Bruce Fields <bfields@redhat.com>2010-11-19 18:35:11 -0500
commit43b0178eda1e7e5d1e205bbfd076ab5d6ecacc02 (patch)
tree522d3a6e49ff805eea06c5e1633b0e949a90a49b
parente53beacd23d9cb47590da6a7a7f6d417b941a994 (diff)
downloadop-kernel-dev-43b0178eda1e7e5d1e205bbfd076ab5d6ecacc02.zip
op-kernel-dev-43b0178eda1e7e5d1e205bbfd076ab5d6ecacc02.tar.gz
nfsd: fix NULL dereference in setattr()
The original code would oops if this were called from nfsd4_setattr() because "filpp" is NULL. (Note this case is currently impossible, as long as we only give out read delegations.) Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index ad2bfa6..2d19129 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -3081,9 +3081,10 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
if (status)
goto out;
renew_client(dp->dl_client);
- if (filpp)
+ if (filpp) {
*filpp = find_readable_file(dp->dl_file);
- BUG_ON(!*filpp);
+ BUG_ON(!*filpp);
+ }
} else { /* open or lock stateid */
stp = find_stateid(stateid, flags);
if (!stp)
OpenPOWER on IntegriCloud