Skip to content

Commit

Permalink
ncpfs: fix wrong check in __ncp_ioctl()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Cc: Julia Lawall <[email protected]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[email protected]>
Cc: Petr Vandrovec <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
bzolnier authored and torvalds committed Sep 23, 2009
1 parent 1b83df3 commit 8b2feb1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ncpfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8b2feb1

Please sign in to comment.