Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5173cb81 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Jens Axboe
Browse files

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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent 29fd20b8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
		}