public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Steve French <sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org>,
	Pavel Shilovsky <piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org>
Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [patch] cifs: fix error code in cifs_match_super()
Date: Fri, 20 Jun 2014 19:22:05 +0000	[thread overview]
Message-ID: <20140620192205.GC19824@mwanda> (raw)

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 <dan.carpenter@oracle.com>
---
This is a static checker warning and I'm not certain this is the correct
fix.  Please review this one carefully.

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;

             reply	other threads:[~2014-06-20 19:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20 19:22 Dan Carpenter [this message]
2014-06-21 20:06 ` [patch] cifs: fix error code in cifs_match_super() Shirish Pargaonkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140620192205.GC19824@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=kernel-janitors-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=piastry-7qunaywFIewox3rIn2DAYQ@public.gmane.org \
    --cc=samba-technical-w/Ol4Ecudpl8XjKLYN78aQ@public.gmane.org \
    --cc=sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox