]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit3dbee5a4044650f60934d7ef3a2d65ceafa9fc75
tree4201a1ab96f75d4b439144955e527ea1ca3e5bab
parentb274c0e269423471bb0ffc57f265b6d018f108e4
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: 2c701edbbcfb ("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