DMA Engine development
 help / color / mirror / Atom feed
* [PATCH] dmaengine: dw-axi-dmac: fix cfgr_clk leak when core_clk enable fails
@ 2026-08-31  9:44 Li Youhong
  2026-08-31  9:58 ` sashiko-bot
  2026-08-31 15:07 ` Frank Li
  0 siblings, 2 replies; 3+ messages in thread
From: Li Youhong @ 2026-08-31  9:44 UTC (permalink / raw)
  To: Eugeniy.Paltsev, vkoul; +Cc: Frank.Li, dmaengine, Li Youhong

From: Li Youhong <liyouhong@kylinos.cn>

axi_dma_resume() enables cfgr_clk then core_clk. If enabling
core_clk fails, return without disabling cfgr_clk, leaking the
already-enabled clock. Disable cfgr_clk on that error path.

Fixes: 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver")
Signed-off-by: Li Youhong <liyouhong@kylinos.cn>
---
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
index eebed2474210..6ccb3fcfa397 100644
--- a/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
+++ b/drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
@@ -1335,8 +1335,10 @@ static int axi_dma_resume(struct axi_dma_chip *chip)
 		return ret;
 
 	ret = clk_prepare_enable(chip->core_clk);
-	if (ret < 0)
+	if (ret < 0) {
+		clk_disable_unprepare(chip->cfgr_clk);
 		return ret;
+	}
 
 	axi_dma_enable(chip);
 	axi_dma_irq_enable(chip);
-- 
2.25.1


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

end of thread, other threads:[~2026-08-31 15:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-31  9:44 [PATCH] dmaengine: dw-axi-dmac: fix cfgr_clk leak when core_clk enable fails Li Youhong
2026-08-31  9:58 ` sashiko-bot
2026-08-31 15:07 ` Frank Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox