public inbox for linux-cifs@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: linux-cifs@vger.kernel.org
Subject: [bug report] CIFS: Migrate to shared superblock model
Date: Tue, 21 Sep 2021 23:36:00 +0300	[thread overview]
Message-ID: <20210921203600.GC16529@kili> (raw)

[ Ancient code before of the rename ]

Hello Samba devs,

The patch 25c7f41e9234: "CIFS: Migrate to shared superblock model"
from May 26, 2011, leads to the following
Smatch static checker warning:

	fs/smbfs_client/connect.c:2392 cifs_match_super()
	warn: 'tlink' isn't an ERR_PTR

fs/smbfs_client/connect.c
    2377 int
    2378 cifs_match_super(struct super_block *sb, void *data)
    2379 {
    2380         struct cifs_mnt_data *mnt_data = (struct cifs_mnt_data *)data;
    2381         struct smb3_fs_context *ctx;
    2382         struct cifs_sb_info *cifs_sb;
    2383         struct TCP_Server_Info *tcp_srv;
    2384         struct cifs_ses *ses;
    2385         struct cifs_tcon *tcon;
    2386         struct tcon_link *tlink;
    2387         int rc = 0;
    2388 
    2389         spin_lock(&cifs_tcp_ses_lock);
    2390         cifs_sb = CIFS_SB(sb);
    2391         tlink = cifs_get_tlink(cifs_sb_master_tlink(cifs_sb));
--> 2392         if (IS_ERR(tlink)) {

cifs_sb_master_tlink() doesn't return error pointers.  Smatch thinks it
might return NULL though.  Hard to tell.  NULL would crash.

    2393                 spin_unlock(&cifs_tcp_ses_lock);
    2394                 return rc;
    2395         }
    2396         tcon = tlink_tcon(tlink);

regards,
dan carpenter

                 reply	other threads:[~2021-09-21 20:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210921203600.GC16529@kili \
    --to=dan.carpenter@oracle.com \
    --cc=linux-cifs@vger.kernel.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