Skip to content

Commit

Permalink
dmaengine: jz4740: disable/unprepare clk if probe fails
Browse files Browse the repository at this point in the history
[ Upstream commit eb94369 ]

in error path of jz4740_dma_probe(), call clk_disable_unprepare() to clean
up.

Found by Linux Driver Verification project (linuxtesting.org).

Fixes: 25ce6c3 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: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Tobias Jordan authored and gregkh committed Feb 25, 2018
1 parent 4826773 commit 58d3cc9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/dma/dma-jz4740.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit 58d3cc9

Please sign in to comment.