summaryrefslogtreecommitdiff
path: root/drivers/s390/crypto/zcrypt_pcixcc.c
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavo@embeddedor.com>2018-10-18 19:59:39 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2018-10-20 01:27:49 +0300
commitf4445bb93d82a984657b469e63118c2794a4c3d3 (patch)
tree8c236640b2e13c82240ff40109a9b9ccc4e2d17d /drivers/s390/crypto/zcrypt_pcixcc.c
parentd592dd64006f8026e2639e81b9705b20824b73fc (diff)
downloadlinux-f4445bb93d82a984657b469e63118c2794a4c3d3.tar.xz
scsi: hisi_sas: Fix NULL pointer dereference
There is a NULL pointer dereference in case *slot* happens to be NULL at lines 1053 and 1878: struct hisi_sas_cq *cq = &hisi_hba->cq[slot->dlvry_queue]; Notice that *slot* is being NULL checked at lines 1057 and 1881: if (slot), which implies it may be NULL. Fix this by placing the declaration and definition of variable cq, which contains the pointer dereference slot->dlvry_queue, after slot has been properly NULL checked. Addresses-Coverity-ID: 1474515 ("Dereference before null check") Addresses-Coverity-ID: 1474520 ("Dereference before null check") Fixes: 584f53fe5f52 ("scsi: hisi_sas: Fix the race between IO completion and timeout for SMP/internal IO") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: Xiang Chen <chenxiang66@hisilicon.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/s390/crypto/zcrypt_pcixcc.c')
0 files changed, 0 insertions, 0 deletions