Skip to content

Commit c3b2147

Browse files
Thomas-fouriermartinkpetersen
authored andcommitted
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: 818c7f8 ("scsi: qla2xxx: Add changes in preparation for vendor extended FDMI/RDP") Signed-off-by: Thomas Fourier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 85d6fbc commit c3b2147

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/qla2xxx/qla_mbx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2147,7 +2147,7 @@ qla24xx_get_port_database(scsi_qla_host_t *vha, u16 nport_handle,
21472147

21482148
pdb_dma = dma_map_single(&vha->hw->pdev->dev, pdb,
21492149
sizeof(*pdb), DMA_FROM_DEVICE);
2150-
if (!pdb_dma) {
2150+
if (dma_mapping_error(&vha->hw->pdev->dev, pdb_dma)) {
21512151
ql_log(ql_log_warn, vha, 0x1116, "Failed to map dma buffer.\n");
21522152
return QLA_MEMORY_ALLOC_FAILED;
21532153
}

0 commit comments

Comments
 (0)