dmaengine: ioat: Fix error handling path
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Fri, 17 Nov 2017 21:37:53 +0000 (22:37 +0100)
committerVinod Koul <vinod.koul@intel.com>
Wed, 29 Nov 2017 14:17:46 +0000 (19:47 +0530)
If the last test in 'ioat_dma_self_test()' fails, we must release all
the allocated resources and not just part of them.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/ioat/init.c

index 2f31d3d..7792a91 100644 (file)
@@ -390,7 +390,7 @@ static int ioat_dma_self_test(struct ioatdma_device *ioat_dma)
        if (memcmp(src, dest, IOAT_TEST_SIZE)) {
                dev_err(dev, "Self-test copy failed compare, disabling\n");
                err = -ENODEV;
-               goto free_resources;
+               goto unmap_dma;
        }
 
 unmap_dma: