summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <stfrench@microsoft.com>2021-11-11 23:18:14 +0100
committerSteve French <stfrench@microsoft.com>2021-11-12 17:22:05 +0100
commitbac35395d27c4b406fec0a6c2528744f64de6e13 (patch)
tree267fbd915f7a4691b1f9c25ab19bd7079653a775 /fs
parentsmb3: add additional null check in SMB2_open (diff)
downloadlinux-bac35395d27c4b406fec0a6c2528744f64de6e13.tar.xz
linux-bac35395d27c4b406fec0a6c2528744f64de6e13.zip
smb3: add additional null check in SMB2_tcon
Although unlikely to be possible for rsp to be null here, the check is safer to add, and quiets a Coverity warning. Addresses-Coverity: 1420428 ("Explicit null dereferenced") Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/smb2pdu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 48679e0c8392..243de87b2d6d 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1840,7 +1840,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
cifs_small_buf_release(req);
rsp = (struct smb2_tree_connect_rsp *)rsp_iov.iov_base;
trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc);
- if (rc != 0) {
+ if ((rc != 0) || (rsp == NULL)) {
cifs_stats_fail_inc(tcon, SMB2_TREE_CONNECT_HE);
tcon->need_reconnect = true;
goto tcon_error_exit;