* [PATCH] scsi: qla2xxx: Fix dma mapping test in `qla24xx_get_port_database()`
@ 2025-06-17 16:11 Thomas Fourier
2025-06-25 1:47 ` Martin K. Petersen
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Fourier @ 2025-06-17 16:11 UTC (permalink / raw)
Cc: Thomas Fourier, Nilesh Javali, GR-QLogic-Storage-Upstream,
James E.J. Bottomley, Martin K. Petersen, Joe Carnuccio,
Himanshu Madhani, linux-scsi, linux-kernel
`dma_map_XXX()` functions return as error values DMA_MAPPING_ERROR which
is often ~0. The error value should be tested with
`dma_mapping_error()` like it was done in `qla26xx_dport_diagnostics()`.
Fixes: 818c7f87a177 ("scsi: qla2xxx: Add changes in preparation for vendor extended FDMI/RDP")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
drivers/scsi/qla2xxx/qla_mbx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 0cd6f3e14882..13b6cb1b93ac 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -2147,7 +2147,7 @@ qla24xx_get_port_database(scsi_qla_host_t *vha, u16 nport_handle,
pdb_dma = dma_map_single(&vha->hw->pdev->dev, pdb,
sizeof(*pdb), DMA_FROM_DEVICE);
- if (!pdb_dma) {
+ if (dma_mapping_error(&vha->hw->pdev->dev, pdb_dma)) {
ql_log(ql_log_warn, vha, 0x1116, "Failed to map dma buffer.\n");
return QLA_MEMORY_ALLOC_FAILED;
}
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] scsi: qla2xxx: Fix dma mapping test in `qla24xx_get_port_database()`
2025-06-17 16:11 [PATCH] scsi: qla2xxx: Fix dma mapping test in `qla24xx_get_port_database()` 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, GR-QLogic-Storage-Upstream,
James E.J. Bottomley, Joe Carnuccio, Himanshu Madhani,
linux-scsi, linux-kernel
On Tue, 17 Jun 2025 18:11:11 +0200, Thomas Fourier wrote:
> `dma_map_XXX()` functions return as error values DMA_MAPPING_ERROR which
> is often ~0. The error value should be tested with
> `dma_mapping_error()` like it was done in `qla26xx_dport_diagnostics()`.
>
>
Applied to 6.16/scsi-fixes, thanks!
[1/1] scsi: qla2xxx: Fix dma mapping test in `qla24xx_get_port_database()`
https://git.kernel.org/mkp/scsi/c/c3b214719a87
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-25 1:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-17 16:11 [PATCH] scsi: qla2xxx: Fix dma mapping test in `qla24xx_get_port_database()` 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
all inboxes | Powered by JetHome®