nfsd: fix NULL pointer dereference in cld_pipe_downcall
Subsystems (2)
PATCH 1/1 nfsd: fix NULL pointer dereference in cld_pipe_downcall
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 <[email protected]>
Signed-off-by Jeff Layton <[email protected]>
--- fs/nfsd/nfs4recover.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
fs/nfsd/nfs4recover.c +1 -2
@@ -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 ; }
Signature · 1 line
1.7.7.6
J. Bruce Fields
AppliedQuoted 3 lines · Jeff Layton
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.
Thanks, applied.--b.
Quoted 24 lines
Reported-by Dan Carpenter <[email protected]>Signed-off-by Jeff Layton <[email protected]>--- fs/nfsd/nfs4recover.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)fs/nfsd/nfs4recover.c +1
-2@@ -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 ; }Signature · 1 line
1.7.7.6