diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2016-03-18 23:35:54 +0100 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2016-03-19 02:10:59 +0100 |
commit | 5173cb814b36439a9d9537016965e75798b9f130 (patch) | |
tree | 3c4111bb8f7e0217bf3e29b755f574045ae7571f /drivers/block | |
parent | lightnvm: do not load L2P table if not supported (diff) | |
download | linux-5173cb814b36439a9d9537016965e75798b9f130.tar.xz linux-5173cb814b36439a9d9537016965e75798b9f130.zip |
mtip32xx: fix checks for dma mapping errors
exec_drive_taskfile() checks for dma mapping errors by comparison
returned address with zero, while pci_dma_mapping_error() should be used.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/mtip32xx/mtip32xx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index cc2e71d0a77f..25824c1697c5 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c @@ -2051,7 +2051,7 @@ static int exec_drive_taskfile(struct driver_data *dd, outbuf, taskout, DMA_TO_DEVICE); - if (outbuf_dma == 0) { + if (pci_dma_mapping_error(dd->pdev, outbuf_dma)) { err = -ENOMEM; goto abort; } @@ -2068,7 +2068,7 @@ static int exec_drive_taskfile(struct driver_data *dd, inbuf_dma = pci_map_single(dd->pdev, inbuf, taskin, DMA_FROM_DEVICE); - if (inbuf_dma == 0) { + if (pci_dma_mapping_error(dd->pdev, inbuf_dma)) { err = -ENOMEM; goto abort; } |