Skip to contentSkip to conversation

isci: Fix dma_unmap_sg() nents value

PATCH Applied Thomas Fourier 2 participants 3 messages Jun 27, 2025 – Jul 22, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 isci: 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 ddcc7e347a89 ("isci: fix dma_unmap_sg usage")
---
 drivers/scsi/isci/request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/isci/request.c +1 -1
index 355a0bc0828e..bb89a2e33eb4 100644
@@ -2904,7 +2904,7 @@ static void isci_request_io_request_complete(struct isci_host *ihost,
 					 task->total_xfer_len, task->data_dir);
 		else  /* unmap the sgl dma addresses */
 			dma_unmap_sg(&ihost->pdev->dev, task->scatter,
-				     request->num_sg_entries, task->data_dir);
+				     task->num_scatter, task->data_dir);
 		break;
 	case SAS_PROTOCOL_SMP: {
 		struct scatterlist *sg = &task->smp_task.smp_req;
Signature · 1 line
2.43.0
#1 lore raw

Thomas,

Quoted 2 lines

The dma_unmap_sg() functions should be called with the same nents as the dma_map_sg(), not the value the map function returned.

Applied to 6.17/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen