aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ntb
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-01-23 11:33:56 +0300
committerJon Mason <jdmason@kudzu.us>2018-01-28 22:17:24 -0500
commitcd20dc3ca75f17fd391e825b1606050bd62703fc (patch)
tree55baf1f3aee9d17eaed27f0e6e826cb6f7e09b4b /drivers/ntb
parentntb_hw_switchtec: Make function switchtec_ntb_remove() static (diff)
downloadlinux-dev-cd20dc3ca75f17fd391e825b1606050bd62703fc.tar.xz
linux-dev-cd20dc3ca75f17fd391e825b1606050bd62703fc.zip
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>
Diffstat (limited to 'drivers/ntb')
-rw-r--r--drivers/ntb/test/ntb_perf.c3
1 files changed, 2 insertions, 1 deletions
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;
}