Skip to contentSkip to conversation

ntb_perf: Fix an error code in perf_copy_chunk()

PATCH Applied Dan Carpenter 3 participants 3 messages Jan 23, 2018 – Jan 24, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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().

drivers/ntb/test/ntb_perf.c +2 -1
index 8de72f3fba4d..387e685063fc 100644
@@ -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;
 	}
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Dan Carpenter

We accidentally return success if dmaengine_submit() fails. The fix is to preserve the error code from dma_submit_error().

Yep, absolutely right. Thanks!

Quoted 16 lines
drivers/ntb/test/ntb_perf.c +2 -1
index 8de72f3fba4d..387e685063fc 100644
@@ -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;
 	}
maintainer Applied
#2 lore raw
In reply to Dan Carpenter
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 from dma_submit_error().

Yep, absolutely right. Thanks!

Applied to ntb-next

Thanks,
Jon

Quoted 17 lines
Quoted 17 lines
drivers/ntb/test/ntb_perf.c +2 -1
index 8de72f3fba4d..387e685063fc 100644
@@ -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;
 	}