Skip to contentSkip to conversation

dma: dw-axi-dmac: Release the clock resources

PATCH New Zhen Ni 1 participant 1 message Oct 10, 2025

Subsystems (3)
lore
Share & tools
lore

Zhen Ni

author
#0 lore raw

PATCH 1/1 dma: dw-axi-dmac: Release the clock resources

In axi_dma_resume(), if clk_prepare_enable(chip->core_clk) fails, chip->cfgr_clk remains enabled and is not disabled. This could lead to resource leaks and inconsistent state during error handling.

Ensure that cfgr_clk is properly disabled.

Fixes 1fe20f1b8454 ("dmaengine: Introduce DW AXI DMAC driver")
---
 drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c +3 -1
index b23536645ff7..ab70dbe54f46 100644
@@ -1334,8 +1334,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);
Signature · 1 line
2.20.1