Commit 76cb25b0 authored by Deepak Ukey's avatar Deepak Ukey Committed by Martin K. Petersen

scsi: pm80xx: Corrected dma_unmap_sg() parameter

For the function dma_unmap_sg(), the <nents> parameter should be number of
elements in the scatter list prior to the mapping, not after the mapping.
Signed-off-by: default avatarDeepak Ukey <deepak.ukey@microchip.com>
Signed-off-by: default avatarViswas G <Viswas.G@microchip.com>
Acked-by: default avatarJack Wang <jinpu.wang@profitbricks.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent cd135754
......@@ -488,7 +488,7 @@ static int pm8001_task_exec(struct sas_task *task,
dev_printk(KERN_ERR, pm8001_ha->dev, "pm8001 exec failed[%d]!\n", rc);
if (!sas_protocol_ata(t->task_proto))
if (n_elem)
dma_unmap_sg(pm8001_ha->dev, t->scatter, n_elem,
dma_unmap_sg(pm8001_ha->dev, t->scatter, t->num_scatter,
t->data_dir);
out_done:
spin_unlock_irqrestore(&pm8001_ha->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment