dma: dw-axi-dmac: Release the clock resources
Subsystems (3)
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")
Signed-off-by Zhen Ni <[email protected]>
--- 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
@@ -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