Skip to content

Commit

Permalink
nfsd: fix NULL pointer dereference in cld_pipe_downcall
Browse files Browse the repository at this point in the history
If we find that "cup" is NULL in this case, then we obviously don't
want to dereference it. What we really want to print in this case
is the xid that we copied off earlier.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
  • Loading branch information
jtlayton authored and J. Bruce Fields committed Mar 28, 2012
1 parent 3af7061 commit 21f72c9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions fs/nfsd/nfs4recover.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,8 +602,7 @@ cld_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)

/* couldn't find upcall? */
if (!cup) {
dprintk("%s: couldn't find upcall -- xid=%u\n", __func__,
cup->cu_msg.cm_xid);
dprintk("%s: couldn't find upcall -- xid=%u\n", __func__, xid);
return -EINVAL;
}

Expand Down

0 comments on commit 21f72c9

Please sign in to comment.