All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: jz4740: disable/unprepare clk if probe fails
@ 2017-12-06 13:28 Tobias Jordan
  2017-12-11  3:30 ` Vinod Koul
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Jordan @ 2017-12-06 13:28 UTC (permalink / raw)
  To: Dan Williams, Vinod Koul, dmaengine, linux-kernel

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>
---
 drivers/dma/dma-jz4740.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;
 }
 
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: jz4740: disable/unprepare clk if probe fails
  2017-12-06 13:28 [PATCH] dmaengine: jz4740: disable/unprepare clk if probe fails Tobias Jordan
@ 2017-12-11  3:30 ` Vinod Koul
  0 siblings, 0 replies; 2+ messages in thread
From: Vinod Koul @ 2017-12-11  3:30 UTC (permalink / raw)
  To: Tobias Jordan; +Cc: Dan Williams, dmaengine, linux-kernel

On Wed, Dec 06, 2017 at 02:28:27PM +0100, Tobias Jordan wrote:
> in error path of jz4740_dma_probe(), call clk_disable_unprepare() to clean
> up.
> 
> Found by Linux Driver Verification project (linuxtesting.org).

Applied, thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-12-11  3:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-06 13:28 [PATCH] dmaengine: jz4740: disable/unprepare clk if probe fails Tobias Jordan
2017-12-11  3:30 ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.