Skip to content

Commit 00f452a

Browse files
Thomas-fouriermartinkpetersen
authored andcommitted
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: b3a271a ("[SCSI] qla4xxx: support iscsiadm session mgmt") Signed-off-by: Thomas Fourier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent c3b2147 commit 00f452a

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)