cifs: fix incorrect check for null pointer in header_assemble
authorSteve French <stfrench@microsoft.com>
Fri, 24 Sep 2021 00:18:37 +0000 (19:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 08:23:38 +0000 (10:23 +0200)
commit7c26d7b1f07209a8f514e5821023379645433bc9
tree8baa5a26bf72c19e99df4e2d3c7de9cc4dc4176d
parent2a6992e7a05677bfcfd7e60498fe52831fbb3da7
cifs: fix incorrect check for null pointer in header_assemble

commit 9ed38fd4a15417cac83967360cf20b853bfab9b6 upstream.

Although very unlikely that the tlink pointer would be null in this case,
get_next_mid function can in theory return null (but not an error)
so need to check for null (not for IS_ERR, which can not be returned
here).

Address warning:

        fs/smbfs_client/connect.c:2392 cifs_match_super()
        warn: 'tlink' isn't an ERR_PTR

Pointed out by Dan Carpenter via smatch code analysis tool

CC: stable@vger.kernel.org
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/connect.c