From patchwork Tue Oct 6 06:09:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hitoshi Mitake X-Patchwork-Id: 51879 Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n966Gcfr021135 for ; Tue, 6 Oct 2009 06:16:39 GMT Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id 40C3DAD19B; Tue, 6 Oct 2009 00:15:50 -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=-3.3 required=3.8 tests=BAYES_00, SPF_HELO_SOFTFAIL, SPF_PASS autolearn=no version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org X-Greylist: delayed 404 seconds by postgrey-1.32 at fn.samba.org; Tue, 06 Oct 2009 00:15:44 MDT Received: from ns.dcl.info.waseda.ac.jp (ns.dcl.info.waseda.ac.jp [133.9.216.194]) by lists.samba.org (Postfix) with ESMTP id B17D3AD0F9 for ; Tue, 6 Oct 2009 00:15:44 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by ns.dcl.info.waseda.ac.jp (Postfix) with ESMTP id 9A42AA82B7A; Tue, 6 Oct 2009 15:09:47 +0900 (JST) X-Virus-Scanned: amavisd-new at dcl.info.waseda.ac.jp Received: from ns.dcl.info.waseda.ac.jp ([127.0.0.1]) by localhost (ns.dcl.info.waseda.ac.jp [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zfjQOQbQhB-H; Tue, 6 Oct 2009 15:09:47 +0900 (JST) Received: from localhost (fw-cisco.dcl.info.waseda.ac.jp [133.9.216.204]) by ns.dcl.info.waseda.ac.jp (Postfix) with ESMTP id 4D061A82B71; Tue, 6 Oct 2009 15:09:47 +0900 (JST) Date: Tue, 06 Oct 2009 15:09:47 +0900 (JST) Message-Id: <20091006.150947.464229135556506065.mitake@dcl.info.waseda.ac.jp> To: linux-cifs-client@lists.samba.org From: Hitoshi Mitake X-Mailer: Mew version 5.2 on Emacs 22.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Subject: [linux-cifs-client] Fw: [PATCH] Fixing to avoid invalid kfree() in cifs_get_tcp_session() of fs/cifs/connect.c 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: , Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 43003e0..b090980 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1577,7 +1577,8 @@ cifs_get_tcp_session(struct smb_vol *volume_info) out_err: if (tcp_ses) { - kfree(tcp_ses->hostname); + if (!IS_ERR(tcp_ses->hostname)) + kfree(tcp_ses->hostname); if (tcp_ses->ssocket) sock_release(tcp_ses->ssocket); kfree(tcp_ses);