scsi: qla2xxx: Fix DMA mapping test in qla24xx_get_port_database()
[ Upstream commit c3b214719a87735d4f67333a8ef3c0e31a34837c ]
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: 818c7f87a1
("scsi: qla2xxx: Add changes in preparation for vendor extended FDMI/RDP")
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Link: https://lore.kernel.org/r/20250617161115.39888-2-fourier.thomas@gmail.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8ca65fa710
commit
c3ec87fbb0
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user