Commit 8b2feb10 authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Linus Torvalds

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: default avatarDan Carpenter <error27@gmail.com>
Cc: Julia Lawall <julia@diku.dk>
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1b83df30
...@@ -442,7 +442,7 @@ static int __ncp_ioctl(struct inode *inode, struct file *filp, ...@@ -442,7 +442,7 @@ static int __ncp_ioctl(struct inode *inode, struct file *filp,
if (dentry) { if (dentry) {
struct inode* s_inode = dentry->d_inode; struct inode* s_inode = dentry->d_inode;
if (inode) { if (s_inode) {
NCP_FINFO(s_inode)->volNumber = vnum; NCP_FINFO(s_inode)->volNumber = vnum;
NCP_FINFO(s_inode)->dirEntNum = de; NCP_FINFO(s_inode)->dirEntNum = de;
NCP_FINFO(s_inode)->DosDirNum = dosde; NCP_FINFO(s_inode)->DosDirNum = dosde;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment