scsi: qla4xxx: Fix missing DMA mapping error in qla4xxx_alloc_pdu()
[ Upstream commit 00f452a1b084efbe8dcb60a29860527944a002a1 ]
dma_map_XXX() can fail and should be tested for errors with
dma_mapping_error().
Fixes: b3a271a94d
("[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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c3ec87fbb0
commit
39dac98aca
@@ -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",
|
||||
|
Reference in New Issue
Block a user