summaryrefslogtreecommitdiffstats
path: root/drivers/dma/dma-jz4740.c
diff options
context:
space:
mode:
authorTobias Jordan <Tobias.Jordan@elektrobit.com>2017-12-06 14:28:27 +0100
committerVinod Koul <vinod.koul@intel.com>2017-12-11 04:30:06 +0100
commiteb9436966fdc84cebdf222952a99898ab46d9bb0 (patch)
tree086fe66462a5cf2ec0549ff2d86f23156c5be9c2 /drivers/dma/dma-jz4740.c
parentdmaengine: dmatest: move callback wait queue to thread context (diff)
downloadlinux-eb9436966fdc84cebdf222952a99898ab46d9bb0.tar.xz
linux-eb9436966fdc84cebdf222952a99898ab46d9bb0.zip
dmaengine: jz4740: disable/unprepare clk if probe fails
in error path of jz4740_dma_probe(), call clk_disable_unprepare() to clean up. Found by Linux Driver Verification project (linuxtesting.org). Fixes: 25ce6c35fea0 MIPS: jz4740: Remove custom DMA API Signed-off-by: Tobias Jordan <Tobias.Jordan@elektrobit.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/dma-jz4740.c')
-rw-r--r--drivers/dma/dma-jz4740.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c
index d50273fed715..afd5e10f8927 100644
--- a/drivers/dma/dma-jz4740.c
+++ b/drivers/dma/dma-jz4740.c
@@ -555,7 +555,7 @@ static int jz4740_dma_probe(struct platform_device *pdev)
ret = dma_async_device_register(dd);
if (ret)
- return ret;
+ goto err_clk;
irq = platform_get_irq(pdev, 0);
ret = request_irq(irq, jz4740_dma_irq, 0, dev_name(&pdev->dev), dmadev);
@@ -568,6 +568,8 @@ static int jz4740_dma_probe(struct platform_device *pdev)
err_unregister:
dma_async_device_unregister(dd);
+err_clk:
+ clk_disable_unprepare(dmadev->clk);
return ret;
}