scsi: hisi_sas: add null check before indirect pointer dereference
authorGustavo A. R. Silva <garsilva@embeddedor.com>
Mon, 22 May 2017 18:00:29 +0000 (13:00 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 13 Jun 2017 00:48:05 +0000 (20:48 -0400)
Add null check before indirectly dereferencing pointer task->lldd_task
in statement u32 tag = slot->idx;

Addresses-Coverity-ID: 1373843
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_main.c

index d622db502ec98b4b2d2599d2fad9d5c05641ac4b..f720d3ced85177bafc896fd728cccb0efa0b46bf 100644 (file)
@@ -963,7 +963,7 @@ static int hisi_sas_abort_task(struct sas_task *task)
                                                     HISI_SAS_INT_ABT_DEV, 0);
                        rc = hisi_sas_softreset_ata_disk(device);
                }
-       } else if (task->task_proto & SAS_PROTOCOL_SMP) {
+       } else if (task->lldd_task && task->task_proto & SAS_PROTOCOL_SMP) {
                /* SMP */
                struct hisi_sas_slot *slot = task->lldd_task;
                u32 tag = slot->idx;