diff options
author | Pan Bian <bianpan2016@163.com> | 2017-08-08 15:55:30 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-08-11 01:55:35 +0200 |
commit | 0b2ce198fa3a6a0c885e888010b7278778df2dab (patch) | |
tree | 216268a82543f9340e07ff9e6be09d6770d1ca23 | |
parent | scsi: mvsas: replace kfree with scsi_host_put (diff) | |
download | linux-0b2ce198fa3a6a0c885e888010b7278778df2dab.tar.xz linux-0b2ce198fa3a6a0c885e888010b7278778df2dab.zip |
scsi: qla2xxx: use dma_mapping_error to check map errors
The return value of dma_map_single() should be checked by
dma_mapping_error(). However, in function qla26xx_dport_diagnostics(), its
return value is checked against NULL, which could result in failures.
Signed-off-by: Pan Bian <bianpan2016@163.com>
Acked-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 28728c49d8df..1f91b87b6416 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c @@ -5809,7 +5809,7 @@ qla26xx_dport_diagnostics(scsi_qla_host_t *vha, dd_dma = dma_map_single(&vha->hw->pdev->dev, dd_buf, size, DMA_FROM_DEVICE); - if (!dd_dma) { + if (dma_mapping_error(&vha->hw->pdev->dev, dd_dma)) { ql_log(ql_log_warn, vha, 0x1194, "Failed to map dma buffer.\n"); return QLA_MEMORY_ALLOC_FAILED; } |