]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
scsi: pm80xx: Corrected dma_unmap_sg() parameter
authorDeepak Ukey <deepak.ukey@microchip.com>
Tue, 11 Sep 2018 08:48:03 +0000 (14:18 +0530)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 12 Sep 2018 01:13:49 +0000 (21:13 -0400)
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: Deepak Ukey <deepak.ukey@microchip.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Acked-by: Jack Wang <jinpu.wang@profitbricks.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/pm8001/pm8001_sas.c

index d8249675371e9b7356145769ba86a56b8d4e5b3f..e063faad66f5f6acd9c7aeafefc477f65231a249 100644 (file)
@@ -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);