提交 eb045e04 编写于 作者: G Gustavo A. R. Silva 提交者: Martin K. Petersen

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: NGustavo A. R. Silva <garsilva@embeddedor.com>
Reviewed-by: NJohn Garry <john.garry@huawei.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 5c146686
...@@ -963,7 +963,7 @@ static int hisi_sas_abort_task(struct sas_task *task) ...@@ -963,7 +963,7 @@ static int hisi_sas_abort_task(struct sas_task *task)
HISI_SAS_INT_ABT_DEV, 0); HISI_SAS_INT_ABT_DEV, 0);
rc = hisi_sas_softreset_ata_disk(device); 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 */ /* SMP */
struct hisi_sas_slot *slot = task->lldd_task; struct hisi_sas_slot *slot = task->lldd_task;
u32 tag = slot->idx; u32 tag = slot->idx;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册