Skip to content

Commit bac3539

Browse files
committed
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) <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 6b78951 commit bac3539

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cifs/smb2pdu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1840,7 +1840,7 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
18401840
cifs_small_buf_release(req);
18411841
rsp = (struct smb2_tree_connect_rsp *)rsp_iov.iov_base;
18421842
trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc);
1843-
if (rc != 0) {
1843+
if ((rc != 0) || (rsp == NULL)) {
18441844
cifs_stats_fail_inc(tcon, SMB2_TREE_CONNECT_HE);
18451845
tcon->need_reconnect = true;
18461846
goto tcon_error_exit;

0 commit comments

Comments
 (0)