]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
dmaengine: dmatest: unmap data on a single code-path when xfer done
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Mon, 29 Oct 2018 10:08:08 +0000 (12:08 +0200)
committerVinod Koul <vkoul@kernel.org>
Sat, 24 Nov 2018 13:46:46 +0000 (19:16 +0530)
After the DMA transfer is done, we don't need to call the un-mapping code
in 3 places. One is enough.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/dma/dmatest.c

index aa1712beb0cc355d454948dddb42d615c10b9762..5d4b1e053fb7ddeaff89a3641a440a4d25d4b1b7 100644 (file)
@@ -721,14 +721,14 @@ static int dmatest_func(void *data)
 
                status = dma_async_is_tx_complete(chan, cookie, NULL, NULL);
 
+               dmaengine_unmap_put(um);
+
                if (!done->done) {
-                       dmaengine_unmap_put(um);
                        result("test timed out", total_tests, src_off, dst_off,
                               len, 0);
                        failed_tests++;
                        continue;
                } else if (status != DMA_COMPLETE) {
-                       dmaengine_unmap_put(um);
                        result(status == DMA_ERROR ?
                               "completion error status" :
                               "completion busy status", total_tests, src_off,
@@ -737,8 +737,6 @@ static int dmatest_func(void *data)
                        continue;
                }
 
-               dmaengine_unmap_put(um);
-
                if (params->noverify) {
                        verbose_result("test passed", total_tests, src_off,
                                       dst_off, len, 0);