cifs: fix unneeded null check
authorSteve French <stfrench@microsoft.com>
Sat, 19 Jun 2021 17:01:37 +0000 (12:01 -0500)
committerSteve French <stfrench@microsoft.com>
Mon, 21 Jun 2021 02:28:17 +0000 (21:28 -0500)
tcon can not be null in SMB2_tcon function so the check
is not relevant and removing it makes Coverity happy.

Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
Addresses-Coverity: 13250131 ("Dereference before null check")
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2pdu.c

index 29b729d..0005989 100644 (file)
@@ -1779,10 +1779,8 @@ SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
        rsp = (struct smb2_tree_connect_rsp *)rsp_iov.iov_base;
        trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc);
        if (rc != 0) {
-               if (tcon) {
-                       cifs_stats_fail_inc(tcon, SMB2_TREE_CONNECT_HE);
-                       tcon->need_reconnect = true;
-               }
+               cifs_stats_fail_inc(tcon, SMB2_TREE_CONNECT_HE);
+               tcon->need_reconnect = true;
                goto tcon_error_exit;
        }