diff options
author | Tobias Jordan <Tobias.Jordan@elektrobit.com> | 2017-12-06 16:28:27 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2018-03-03 18:51:51 +0300 |
commit | e953b3f4d136e498d1d4e2cd55866c533ab903e3 (patch) | |
tree | 5470d2c3e3384bfd33db8148c451021698066dd6 | |
parent | e023bef9b5b3b55e391dc10d773ff7b23c4b92c7 (diff) | |
download | linux-e953b3f4d136e498d1d4e2cd55866c533ab903e3.tar.xz |
dmaengine: jz4740: disable/unprepare clk if probe fails
commit eb9436966fdc84cebdf222952a99898ab46d9bb0 upstream.
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>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-rw-r--r-- | drivers/dma/dma-jz4740.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c index 94c380f07538..5ee4317e9e8b 100644 --- a/drivers/dma/dma-jz4740.c +++ b/drivers/dma/dma-jz4740.c @@ -574,7 +574,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); @@ -587,6 +587,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; } |