Skip to content

Commit eb94369

Browse files
Tobias JordanVinod Koul
authored andcommitted
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: 25ce6c3 MIPS: jz4740: Remove custom DMA API Signed-off-by: Tobias Jordan <[email protected]> Signed-off-by: Vinod Koul <[email protected]>
1 parent 6f6a23a commit eb94369

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/dma/dma-jz4740.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ static int jz4740_dma_probe(struct platform_device *pdev)
555555

556556
ret = dma_async_device_register(dd);
557557
if (ret)
558-
return ret;
558+
goto err_clk;
559559

560560
irq = platform_get_irq(pdev, 0);
561561
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)
568568

569569
err_unregister:
570570
dma_async_device_unregister(dd);
571+
err_clk:
572+
clk_disable_unprepare(dmadev->clk);
571573
return ret;
572574
}
573575

0 commit comments

Comments
 (0)