From: Bartlomiej Zolnierkiewicz Date: Tue, 22 Sep 2009 23:45:55 +0000 (-0700) Subject: ncpfs: fix wrong check in __ncp_ioctl() X-Git-Tag: v2.6.32-rc1~296 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b2feb10c907b610bf8a739792c6b967c65445b0;p=platform%2Fkernel%2Flinux-3.10.git ncpfs: fix wrong check in __ncp_ioctl() We want to check for s_inode's existence, not inode's one (inode is always valid in this function). This takes care of the following entry from Dan's list: fs/ncpfs/ioctl.c +445 __ncp_ioctl(180) warning: variable derefenced before check 'inode' Reported-by: Dan Carpenter Cc: Julia Lawall Signed-off-by: Bartlomiej Zolnierkiewicz Cc: Petr Vandrovec Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index fa038df..53a7ed7 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c @@ -442,7 +442,7 @@ static int __ncp_ioctl(struct inode *inode, struct file *filp, if (dentry) { struct inode* s_inode = dentry->d_inode; - if (inode) { + if (s_inode) { NCP_FINFO(s_inode)->volNumber = vnum; NCP_FINFO(s_inode)->dirEntNum = de; NCP_FINFO(s_inode)->DosDirNum = dosde;