Skip to content

Commit fc6e032

Browse files
committed
scsi: qla4xxx: Fix missing DMA mapping error in qla4xxx_alloc_pdu()
JIRA: https://issues.redhat.com/browse/RHEL-121669 dma_map_XXX() can fail and should be tested for errors with dma_mapping_error(). Fixes: b3a271a ("[SCSI] qla4xxx: support iscsiadm session mgmt") Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Link: https://lore.kernel.org/r/20250618071742.21822-2-fourier.thomas@gmail.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> (cherry picked from commit 00f452a) Signed-off-by: Chris Leech <cleech@redhat.com>
1 parent d7b4c1b commit fc6e032

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/scsi/qla4xxx/ql4_os.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3420,6 +3420,8 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
34203420
task_data->data_dma = dma_map_single(&ha->pdev->dev, task->data,
34213421
task->data_count,
34223422
DMA_TO_DEVICE);
3423+
if (dma_mapping_error(&ha->pdev->dev, task_data->data_dma))
3424+
return -ENOMEM;
34233425
}
34243426

34253427
DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n",

0 commit comments

Comments
 (0)