linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: qla4xxx: Fix missing dma mapping error in qla4xxx_alloc_pdu()
@ 2025-06-18  7:17 Thomas Fourier
  2025-06-25  1:47 ` Martin K. Petersen
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Fourier @ 2025-06-18  7:17 UTC (permalink / raw)
  Cc: Thomas Fourier, Nilesh Javali, Manish Rangankar,
	GR-QLogic-Storage-Upstream, James E.J. Bottomley,
	Martin K. Petersen, Mike Christie, James Bottomley,
	Lalit Chandivade, linux-scsi, linux-kernel

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>
---
 drivers/scsi/qla4xxx/ql4_os.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
index d4141656b204..a39f1da4ce47 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",
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] scsi: qla4xxx: Fix missing dma mapping error in qla4xxx_alloc_pdu()
  2025-06-18  7:17 [PATCH] scsi: qla4xxx: Fix missing dma mapping error in qla4xxx_alloc_pdu() Thomas Fourier
@ 2025-06-25  1:47 ` Martin K. Petersen
  0 siblings, 0 replies; 2+ messages in thread
From: Martin K. Petersen @ 2025-06-25  1:47 UTC (permalink / raw)
  To: Thomas Fourier
  Cc: Martin K . Petersen, Nilesh Javali, Manish Rangankar,
	GR-QLogic-Storage-Upstream, James E.J. Bottomley, Mike Christie,
	James Bottomley, Lalit Chandivade, linux-scsi, linux-kernel

On Wed, 18 Jun 2025 09:17:37 +0200, Thomas Fourier wrote:

> 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

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-25  1:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-18  7:17 [PATCH] scsi: qla4xxx: Fix missing dma mapping error in qla4xxx_alloc_pdu() Thomas Fourier
2025-06-25  1:47 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).