From: Jeff Layton Date: Wed, 28 Mar 2012 11:36:01 +0000 (-0400) Subject: nfsd: fix NULL pointer dereference in cld_pipe_downcall X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=21f72c9f0a6774d104fb655bda6099c378518945;p=sagit-ice-cold%2Fkernel_xiaomi_msm8998.git 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 Signed-off-by: Jeff Layton Signed-off-by: J. Bruce Fields --- diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 21b53d57432c..eaaf9482c7f5 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c @@ -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; }