scsi: cxgb4i: Fix dereference of pointer tdata before it is null checked
authorColin Ian King <colin.king@canonical.com>
Thu, 9 Jul 2020 13:52:17 +0000 (14:52 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 14 Jul 2020 03:12:30 +0000 (23:12 -0400)
commitb92a4a9f7be80fd519fc12c976a1bc7abbabf9a5
tree4201a1ab96f75d4b439144955e527ea1ca3e5bab
parentdd06a40201fe8a4db8071b4939fafc5905557b01
scsi: cxgb4i: Fix dereference of pointer tdata before it is null checked

Currently pointer tdata is being dereferenced on the initialization of
pointer skb before tdata is null checked. This could lead to a potential
null pointer dereference.  Fix this by dereferencing tdata after tdata has
been null pointer sanity checked.

Link: https://lore.kernel.org/r/20200709135217.1408105-1-colin.king@canonical.com
Fixes: e33c2482289b ("scsi: cxgb4i: Add support for iSCSI segmentation offload")
Addresses-Coverity: ("Dereference before null check")
Acked-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/cxgbi/libcxgbi.c