summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2021-06-23 19:32:24 -0500
committerSteve French <stfrench@microsoft.com>2021-06-23 19:32:24 -0500
commit162004a2f7ef5c77600e364dc4e9315b0e6ca386 (patch)
tree30a21e8ecf9924eb6ea592a8ff988ca40b5ddf90 /fs/cifs
parenta5628263a9f8d47d9a1548fe9d5d75ba4423a735 (diff)
downloadlinux-162004a2f7ef5c77600e364dc4e9315b0e6ca386.tar.bz2
cifs: missing null pointer check in cifs_mount
We weren't checking if tcon is null before setting dfs path, although we check for null tcon in an earlier assignment statement. Addresses-Coverity: 1476411 ("Dereference after null check") Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-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 8d95607a9312..c8079376d294 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -3451,7 +3451,7 @@ int cifs_mount(struct cifs_sb_info *cifs_sb, struct smb3_fs_context *ctx)
rc = -ELOOP;
} while (rc == -EREMOTE);
- if (rc)
+ if (rc || !tcon)
goto error;
kfree(ref_path);