diff mbox

Kernel oops: NULL pointer dereference in cifs_ioctl on 2.6.37-rc1

Message ID 4CD7B637.1070004@suse.de (mailing list archive)
State New, archived
Headers show

Commit Message

Suresh Jayaraman Nov. 8, 2010, 8:35 a.m. UTC
None
diff mbox

Patch

diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index 2fa22f2..b8f680a 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -35,10 +35,10 @@  long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
 	struct inode *inode = filep->f_dentry->d_inode;
 	int rc = -ENOTTY; /* strange error - but the precedent */
 	int xid;
-	struct cifs_sb_info *cifs_sb;
+	struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
 #ifdef CONFIG_CIFS_POSIX
 	struct cifsFileInfo *pSMBFile = filep->private_data;
-	struct cifsTconInfo *tcon = tlink_tcon(pSMBFile->tlink);
+	struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb);
 	__u64	ExtAttrBits = 0;
 	__u64	ExtAttrMask = 0;
 	__u64   caps = le64_to_cpu(tcon->fsUnixInfo.Capability);
@@ -48,8 +48,6 @@  long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
 
 	cFYI(1, "ioctl file %p  cmd %u  arg %lu", filep, command, arg);
 
-	cifs_sb = CIFS_SB(inode->i_sb);
-
 	switch (command) {
 		case CIFS_IOC_CHECKUMOUNT:
 			cFYI(1, "User unmount attempted");