Skip to contentSkip to conversation

scsi: qla2xxx: Fix dma mapping test in `qla24xx_get_port_database()`

PATCH Applied Thomas Fourier 2 participants 2 messages Jun 17, 2025 – Jun 25, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi: qla2xxx: Fix dma mapping test in `qla24xx_get_port_database()`

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")
---
 drivers/scsi/qla2xxx/qla_mbx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/qla2xxx/qla_mbx.c +1 -1
index 0cd6f3e14882..13b6cb1b93ac 100644
@@ -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;
 	}
Signature · 1 line
2.43.0
#1 lore raw
Quoted 5 lines · Thomas Fourier

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
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering