Skip to content

Commit

Permalink
nfsd: fix NULL dereference in setattr()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dan Carpenter authored and J. Bruce Fields committed Nov 19, 2010
1 parent e53beac commit 43b0178
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 43b0178

Please sign in to comment.