From patchwork Mon Sep 13 18:02:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 175072 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 o8DI2EfS028698 for ; Mon, 13 Sep 2010 18:02:14 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753699Ab0IMSCN (ORCPT ); Mon, 13 Sep 2010 14:02:13 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.120]:35576 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753451Ab0IMSCN (ORCPT ); Mon, 13 Sep 2010 14:02:13 -0400 X-Authority-Analysis: v=1.1 cv=88hQlV/VnhrPhhPadeRuWHBNMc0qRjlK2a7+9yZesI4= c=1 sm=0 a=Z2jlfYVKExsA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=vEOikPZxg7MxcGEL1XMA:9 a=PQU8w7ZSZ7HSdm5LVwqRUokRMJ0A:4 a=jEp0ucaQiEUA:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:58006] helo=mail.poochiereds.net) by cdptpa-oedge01.mail.rr.com (envelope-from ) (ecelerity 2.2.3.46 r()) with ESMTP id 64/6E-29299-2276E8C4; Mon, 13 Sep 2010 18:02:11 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 6C83858173; Mon, 13 Sep 2010 14:02:10 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, shirishpargaonkar@gmail.com Subject: [PATCH] cifs: fix potential double put of TCP session reference Date: Mon, 13 Sep 2010 14:02:10 -0400 Message-Id: <1284400930-24134-1-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.2.2 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, 13 Sep 2010 18:02:15 +0000 (UTC) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 67dad54..88c84a3 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -1706,9 +1706,6 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) if (ses) { cFYI(1, "Existing smb sess found (status=%d)", ses->status); - /* existing SMB ses has a server reference already */ - cifs_put_tcp_session(server); - mutex_lock(&ses->session_mutex); rc = cifs_negotiate_protocol(xid, ses); if (rc) { @@ -1731,6 +1728,9 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) } } mutex_unlock(&ses->session_mutex); + + /* existing SMB ses has a server reference already */ + cifs_put_tcp_session(server); FreeXid(xid); return ses; }