scsi: mvsas: Fix dma_unmap_sg() nents value
PATCH 1/1 scsi: mvsas: Fix dma_unmap_sg() nents value
The dma_unmap_sg() functions should be called with the same nents as the dma_map_sg(), not the value the map function returned.
Fixes b5762948263d ("[SCSI] mvsas: Add Marvell 6440 SAS/SATA driver")
Signed-off-by Thomas Fourier <[email protected]>
--- drivers/scsi/mvsas/mv_sas.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/mvsas/mv_sas.c +2 -2
@@ -818,7 +818,7 @@ static int mvs_task_prep(struct sas_task *task, struct mvs_info *mvi, int is_tmfdev_printk (KERN_ERR , mvi->dev,"mvsas prep failed[%d]!\n" , rc);if (!sas_protocol_ata (task->task_proto))if (n_elem) -dma_unmap_sg (mvi->dev, task->scatter, n_elem, +dma_unmap_sg (mvi->dev, task->scatter, task->num_scatter, task->data_dir); prep_out:return rc;
@@ -864,7 +864,7 @@ static void mvs_slot_task_free(struct mvs_info *mvi, struct sas_task *task,if (!sas_protocol_ata (task->task_proto))if (slot->n_elem)dma_unmap_sg (mvi->dev, task->scatter, - slot->n_elem, task->data_dir); + task->num_scatter, task->data_dir);switch (task->task_proto) {case SAS_PROTOCOL_SMP :
Signature · 1 line
2.43.0
Martin K. Petersen
AppliedThomas,
Quoted 2 lines
The
dma_unmap_sg()functions should be called with the same nents as thedma_map_sg(), not the value the map function returned.
Applied to 6.17/scsi-staging, thanks!
Signature · 1 line
Martin K. Petersen
Martin K. Petersen
AppliedQuoted 4 lines · Thomas Fourier
The
dma_unmap_sg()functions should be called with the same nents as thedma_map_sg(), not the value the map function returned.
Applied to 6.17/scsi-queue, thanks!
[1/1] scsi: mvsas: Fix dma_unmap_sg() nents value
https://git.kernel.org/mkp/scsi/c/0141618727bc
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering