From: Dan Carpenter Date: Tue, 23 Jan 2018 08:33:56 +0000 (+0300) Subject: ntb_perf: Fix an error code in perf_copy_chunk() X-Git-Tag: v5.15~9474^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd20dc3ca75f17fd391e825b1606050bd62703fc;p=platform%2Fkernel%2Flinux-starfive.git 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 Acked-by: Serge Semin Signed-off-by: Jon Mason --- diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c index 1829a17dd461..b376609ffadb 100644 --- a/drivers/ntb/test/ntb_perf.c +++ b/drivers/ntb/test/ntb_perf.c @@ -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; }