ntb_perf: Fix an error code in perf_copy_chunk()
Subsystems (2)
PATCH 1/1 ntb_perf: Fix an error code in perf_copy_chunk()
We accidentally return success if dmaengine_submit() fails. The fix is to preserve the error code from dma_submit_error().
Signed-off-by Dan Carpenter <[email protected]>
drivers/ntb/test/ntb_perf.c +2 -1
@@ -828,7 +828,8 @@ static int perf_copy_chunk(struct perf_thread *pthr, tx->callback_param = pthr;dma_set_unmap (tx, unmap); -if (dma_submit_error (dmaengine_submit (tx))) { + ret =dma_submit_error (dmaengine_submit (tx)); +if (ret) {dmaengine_unmap_put (unmap); goto err_free_resource; }
Quoted 3 lines · Dan Carpenter
We accidentally return success if
dmaengine_submit()fails. The fix is to preserve the error code fromdma_submit_error().
Yep, absolutely right. Thanks!
Acked-by Serge Semin <[email protected]>
Quoted 16 lines
Signed-off-by Dan Carpenter <[email protected]>drivers/ntb/test/ntb_perf.c +2
-1@@ -828,7 +828,8 @@ static int perf_copy_chunk(struct perf_thread *pthr, tx->callback_param = pthr;dma_set_unmap (tx, unmap); -if (dma_submit_error (dmaengine_submit (tx))) { + ret =dma_submit_error (dmaengine_submit (tx)); +if (ret) {dmaengine_unmap_put (unmap); goto err_free_resource; }
Quoted 8 lines · Serge Semin
Quoted 3 lines · Dan Carpenter
We accidentally return success if
dmaengine_submit()fails. The fix is to preserve the error code fromdma_submit_error().Yep, absolutely right. Thanks!
Acked-by Serge Semin <[email protected]>
Applied to ntb-next
Thanks,
Jon
Quoted 17 lines
Quoted 17 lines
Signed-off-by Dan Carpenter <[email protected]>drivers/ntb/test/ntb_perf.c +2
-1@@ -828,7 +828,8 @@ static int perf_copy_chunk(struct perf_thread *pthr, tx->callback_param = pthr;dma_set_unmap (tx, unmap); -if (dma_submit_error (dmaengine_submit (tx))) { + ret =dma_submit_error (dmaengine_submit (tx)); +if (ret) {dmaengine_unmap_put (unmap); goto err_free_resource; }