summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorThomas Fourier <fourier.thomas@gmail.com>2025-06-18 09:17:37 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-10 16:04:45 +0200
commit218ae6bfe2535f0dcdc1890d8fc3ea705fcb1205 (patch)
treeb199bb567de6ca901a03ad191ad8a23e5873f984 /drivers/scsi
parent350dae778b637da0bb2cb6356a5cbbe44f986b0f (diff)
downloadlinux-218ae6bfe2535f0dcdc1890d8fc3ea705fcb1205.tar.gz
linux-218ae6bfe2535f0dcdc1890d8fc3ea705fcb1205.tar.bz2
linux-218ae6bfe2535f0dcdc1890d8fc3ea705fcb1205.zip
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: b3a271a94d00 ("[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>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla4xxx/ql4_os.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index d91f54a6e752..97e9ca5a2a02 100644
--- a/drivers/scsi/qla4xxx/ql4_os.c
+++ b/drivers/scsi/qla4xxx/ql4_os.c
@@ -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",