1
0
Fork 0

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 <dan.carpenter@oracle.com>
Acked-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
hifive-unleashed-5.1
Dan Carpenter 2018-01-23 11:33:56 +03:00 committed by Jon Mason
parent ae07abdb84
commit cd20dc3ca7
1 changed files with 2 additions and 1 deletions

View File

@ -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;
}