From patchwork Tue Sep 14 15:38:24 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 179732 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 o8EFdVUQ014161 for ; Tue, 14 Sep 2010 15:39:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751929Ab0INPja (ORCPT ); Tue, 14 Sep 2010 11:39:30 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.121]:49749 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751270Ab0INPja (ORCPT ); Tue, 14 Sep 2010 11:39:30 -0400 Received: from cdptpa-omtalb.mail.rr.com ([10.127.143.52]) by cdptpa-qmta02.mail.rr.com with ESMTP id <20100914153928839.PFQR23778@cdptpa-qmta02.mail.rr.com> for ; Tue, 14 Sep 2010 15:39:28 +0000 X-Authority-Analysis: v=1.1 cv=nDD+kvg7J3j5g4cdWNAGMjYWcuyaa40dw2N2reZutTs= c=1 sm=0 a=Z2jlfYVKExsA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=VwQbUJbxAAAA:8 a=20KFwNOVAAAA:8 a=vEOikPZxg7MxcGEL1XMA:9 a=upuh7NnRaXrwM4o9MnXZSGBocXgA:4 a=LI9Vle30uBYA:10 a=0kPLrQdw3YYA:10 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:58644] helo=mail.poochiereds.net) by cdptpa-oedge02.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id AE/B4-25579-1F69F8C4; Tue, 14 Sep 2010 15:38:26 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id D1D4E58173; Tue, 14 Sep 2010 11:38:24 -0400 (EDT) From: Jeff Layton To: smfrench@gmail.com Cc: linux-cifs@vger.kernel.org, stable@kernel.org, sjayaraman@suse.de Subject: [PATCH] cifs: fix potential double put of TCP session reference Date: Tue, 14 Sep 2010 11:38:24 -0400 Message-Id: <1284478704-14636-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]); Tue, 14 Sep 2010 15:39:31 +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; }