Skip to contentSkip to conversation

scsi: qla4xxx: Fix missing dma mapping error in qla4xxx_alloc_pdu()

PATCH Applied Thomas Fourier 2 participants 2 messages Jun 18, 2025 – Jun 25, 2025

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

PATCH 1/1 scsi: qla4xxx: Fix missing dma mapping error in qla4xxx_alloc_pdu()

dma_map_XXX() can fail and should be tested for errors with dma_mapping_error().

Fixes b3a271a94d00 ("[SCSI] qla4xxx: support iscsiadm session mgmt")
---
 drivers/scsi/qla4xxx/ql4_os.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/scsi/qla4xxx/ql4_os.c +2 -0
index d4141656b204..a39f1da4ce47 100644
@@ -3420,6 +3420,8 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
 		task_data->data_dma = dma_map_single(&ha->pdev->dev, task->data,
 						     task->data_count,
 						     DMA_TO_DEVICE);
+		if (dma_mapping_error(&ha->pdev->dev, task_data->data_dma))
+			return -ENOMEM;
 	}
 
 	DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n",
Signature · 1 line
2.43.0
#1 lore raw
Quoted 4 lines · Thomas Fourier

dma_map_XXX() can fail and should be tested for errors with dma_mapping_error().

Applied to 6.16/scsi-fixes, thanks!

[1/1] scsi: qla4xxx: Fix missing dma mapping error in qla4xxx_alloc_pdu()

      https://git.kernel.org/mkp/scsi/c/00f452a1b084
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering