Commit 43b0178e authored by Dan Carpenter's avatar Dan Carpenter Committed by J. Bruce Fields

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: default avatarDan Carpenter <error27@gmail.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent e53beacd
...@@ -3081,9 +3081,10 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate, ...@@ -3081,9 +3081,10 @@ nfs4_preprocess_stateid_op(struct nfsd4_compound_state *cstate,
if (status) if (status)
goto out; goto out;
renew_client(dp->dl_client); renew_client(dp->dl_client);
if (filpp) if (filpp) {
*filpp = find_readable_file(dp->dl_file); *filpp = find_readable_file(dp->dl_file);
BUG_ON(!*filpp); BUG_ON(!*filpp);
}
} else { /* open or lock stateid */ } else { /* open or lock stateid */
stp = find_stateid(stateid, flags); stp = find_stateid(stateid, flags);
if (!stp) if (!stp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment