public inbox for linux-cifs@vger.kernel.org
 help / color / mirror / Atom feed
* [bug report] CIFS: Migrate to shared superblock model
@ 2021-09-21 20:36 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2021-09-21 20:36 UTC (permalink / raw)
  To: linux-cifs

[ 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-21 20:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-21 20:36 [bug report] CIFS: Migrate to shared superblock model Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox