From patchwork Mon Nov 8 08:35:03 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suresh Jayaraman X-Patchwork-Id: 307872 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA88ZCSJ030591 for ; Mon, 8 Nov 2010 08:35:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754198Ab0KHIfL (ORCPT ); Mon, 8 Nov 2010 03:35:11 -0500 Received: from cantor.suse.de ([195.135.220.2]:39992 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754185Ab0KHIfL (ORCPT ); Mon, 8 Nov 2010 03:35:11 -0500 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 75EEF93F46; Mon, 8 Nov 2010 09:35:09 +0100 (CET) Message-ID: <4CD7B637.1070004@suse.de> Date: Mon, 08 Nov 2010 14:05:03 +0530 From: Suresh Jayaraman User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.11) Gecko/20100714 SUSE/3.0.6 Thunderbird/3.0.6 MIME-Version: 1.0 To: Steve French , Kjell Rune Skaaraas Cc: Jeff Layton , linux-cifs@vger.kernel.org Subject: Re: Kernel oops: NULL pointer dereference in cifs_ioctl on 2.6.37-rc1 References: <484246.91210.qm@web27103.mail.ukl.yahoo.com> <20101107211202.3b3468dd@corrin.poochiereds.net> In-Reply-To: Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 08 Nov 2010 08:35:13 +0000 (UTC) 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");