Skip to content

Commit 63f94e9

Browse files
committed
cifs: fix missing null session check in mount
Although it is unlikely to be have ended up with a null session pointer calling cifs_try_adding_channels in cifs_mount. Coverity correctly notes that we are already checking for it earlier (when we return from do_dfs_failover), so at a minimum to clarify the code we should make sure we also check for it when we exit the loop so we don't end up calling cifs_try_adding_channels or mount_setup_tlink with a null ses pointer. Addresses-Coverity: 1505608 ("Derefernce after null check") Reviewed-by: Paulo Alcantara (SUSE) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 507345b commit 63f94e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/connect.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3508,7 +3508,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
35083508
rc = -ELOOP;
35093509
} while (rc == -EREMOTE);
35103510

3511-
if (rc || !tcon)
3511+
if (rc || !tcon || !ses)
35123512
goto error;
35133513

35143514
kfree(ref_path);

0 commit comments

Comments
 (0)