提交 dc1e4730 编写于 作者: X Xiang Chen 提交者: Martin K. Petersen

scsi: hisi_sas: fix dma_unmap_sg() parameter

For function dma_unmap_sg(), the <nents> parameter should be number of
elements in the scatterlist prior to the mapping, not after the mapping.

Fix this usage.
Signed-off-by: NXiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: NJohn Garry <john.garry@huawei.com>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 39bade0c
...@@ -192,7 +192,8 @@ void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task, ...@@ -192,7 +192,8 @@ void hisi_sas_slot_task_free(struct hisi_hba *hisi_hba, struct sas_task *task,
if (!sas_protocol_ata(task->task_proto)) if (!sas_protocol_ata(task->task_proto))
if (slot->n_elem) if (slot->n_elem)
dma_unmap_sg(dev, task->scatter, slot->n_elem, dma_unmap_sg(dev, task->scatter,
task->num_scatter,
task->data_dir); task->data_dir);
if (sas_dev) if (sas_dev)
...@@ -431,7 +432,8 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_sas_dq ...@@ -431,7 +432,8 @@ static int hisi_sas_task_prep(struct sas_task *task, struct hisi_sas_dq
dev_err(dev, "task prep: failed[%d]!\n", rc); dev_err(dev, "task prep: failed[%d]!\n", rc);
if (!sas_protocol_ata(task->task_proto)) if (!sas_protocol_ata(task->task_proto))
if (n_elem) if (n_elem)
dma_unmap_sg(dev, task->scatter, n_elem, dma_unmap_sg(dev, task->scatter,
task->num_scatter,
task->data_dir); task->data_dir);
prep_out: prep_out:
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册