Skip to contentSkip to conversation

ncpfs: fix wrong check in __ncp_ioctl()

PATCH New Bartlomiej Zolnierkiewicz 1 participant 1 message Jul 28, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ncpfs: fix wrong check in __ncp_ioctl()

From: Bartlomiej Zolnierkiewicz <[email protected]>
Subject: [PATCH] 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'

---
 fs/ncpfs/ioctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ncpfs/ioctl.c +1 -1
Index: b/fs/ncpfs/ioctl.c
===================================================================
@@ -442,7 +442,7 @@ static int __ncp_ioctl(struct inode *ino
 			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;