From patchwork Mon May 10 11:51:54 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suresh Jayaraman X-Patchwork-Id: 98167 Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4ABqEcR022421 for ; Mon, 10 May 2010 11:52:50 GMT Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id E9A82AD235; Mon, 10 May 2010 05:52:14 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-4.8 required=3.8 tests=AWL,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from victor.provo.novell.com (victor.provo.novell.com [137.65.250.26]) by lists.samba.org (Postfix) with ESMTP id 603DBAD10C for ; Mon, 10 May 2010 05:52:09 -0600 (MDT) Received: from localhost (prv-ext-foundry1int.gns.novell.com [137.65.251.240]) by victor.provo.novell.com with ESMTP; Mon, 10 May 2010 05:51:59 -0600 From: Suresh Jayaraman To: Steve French Date: Mon, 10 May 2010 17:21:54 +0530 Message-Id: <1273492314-15555-1-git-send-email-sjayaraman@suse.de> X-Mailer: git-send-email 1.6.4.2 Cc: linux-cifs-client@lists.samba.org Subject: [linux-cifs-client] [RFC][PATCH] cifs: fix potential cifsFileInfo struct leaks X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 10 May 2010 11:52:50 +0000 (UTC) diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index d791d07..046f0a7 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -251,9 +251,6 @@ int cifs_posix_open(char *full_path, struct inode **pinode, cifs_fattr_to_inode(*pinode, &fattr); } - if (mnt) - cifs_new_fileinfo(*pinode, *pnetfid, NULL, mnt, oflags); - posix_open_ret: kfree(presp_data); return rc; @@ -462,13 +459,10 @@ cifs_create_set_dentry: cFYI(1, "Create worked, get_inode_info failed rc = %d", rc); /* nfsd case - nfs srv does not set nd */ - if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) { + if ((nd == NULL) || (!(nd->flags & LOOKUP_OPEN))) /* mknod case - do not leave file open */ CIFSSMBClose(xid, tcon, fileHandle); - } else if (!(posix_create) && (newinode)) { - cifs_new_fileinfo(newinode, fileHandle, NULL, - nd->path.mnt, oflags); - } + cifs_create_out: kfree(buf); kfree(full_path);