summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorGustavo A. R. Silva <garsilva@embeddedor.com>2017-05-22 13:00:29 -0500
committerMartin K. Petersen <martin.petersen@oracle.com>2017-06-12 20:48:05 -0400
commiteb045e046d5b2aab7710f82c2e5fb1403c69332b (patch)
tree7c4bf94d647baae92c84dab806f5bc1033848c60 /drivers/scsi
parent5c146686e32085e76ad9e2957f3dee9b28fe4f22 (diff)
scsi: hisi_sas: add null check before indirect pointer dereference
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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/hisi_sas/hisi_sas_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index d622db502ec9..f720d3ced851 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -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;