From patchwork Fri Jun 20 19:22:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 4391811 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7263C9F314 for ; Fri, 20 Jun 2014 19:23:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A2716203DC for ; Fri, 20 Jun 2014 19:23:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 81015203DA for ; Fri, 20 Jun 2014 19:23:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755193AbaFTTXY (ORCPT ); Fri, 20 Jun 2014 15:23:24 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:19159 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755075AbaFTTXV (ORCPT ); Fri, 20 Jun 2014 15:23:21 -0400 Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s5KJMOa0022315 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 20 Jun 2014 19:22:25 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet22.oracle.com (8.14.5+Sun/8.14.5) with ESMTP id s5KJMNjP016568 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Jun 2014 19:22:24 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5KJMNvt007755; Fri, 20 Jun 2014 19:22:23 GMT Received: from mwanda (/41.202.240.2) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 20 Jun 2014 12:22:22 -0700 Date: Fri, 20 Jun 2014 22:22:05 +0300 From: Dan Carpenter To: Steve French , Pavel Shilovsky Cc: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, kernel-janitors@vger.kernel.org Subject: [patch] cifs: fix error code in cifs_match_super() Message-ID: <20140620192205.GC19824@mwanda> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: ucsinet22.oracle.com [156.151.31.94] Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It looks like there is a typo here where return "rc" which is "success" instead of PTR_ERR(tlink) which is a negative error code. I have also removed the unneeded initialization so that GCC has a chance to warn about this sort of thing next time. Fixes: 25c7f41e9234 ('CIFS: Migrate to shared superblock model') Signed-off-by: Dan Carpenter --- This is a static checker warning and I'm not certain this is the correct fix. Please review this one carefully. -- To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 20d75b8..a5704e1 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2730,14 +2730,14 @@ cifs_match_super(struct super_block *sb, void *data) struct cifs_ses *ses; struct cifs_tcon *tcon; struct tcon_link *tlink; - int rc = 0; + int rc; spin_lock(&cifs_tcp_ses_lock); cifs_sb = CIFS_SB(sb); tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb)); if (IS_ERR(tlink)) { spin_unlock(&cifs_tcp_ses_lock); - return rc; + return PTR_ERR(tlink); } tcon = tlink_tcon(tlink); ses = tcon->ses;