summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2021-07-13 19:40:33 -0500
committerSteve French <stfrench@microsoft.com>2021-07-15 19:06:57 -0500
commit63f94e946fafcfc5080b4a4aec9770158268e4ee (patch)
tree7b2069ac9328a33967b1154336005704b042cba2
parent507345b5ae6a57b7ecd7550ff39282ed20de7b8d (diff)
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) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/cifs/connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index d49c9e5c33fa..a1e870232114 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3508,7 +3508,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
rc = -ELOOP;
} while (rc == -EREMOTE);
- if (rc || !tcon)
+ if (rc || !tcon || !ses)
goto error;
kfree(ref_path);