Commit b18cd8b2 authored by Zhen Ni's avatar Zhen Ni Committed by Vinod Koul
Browse files

dmaengine: fsl-edma: Fix clk leak on alloc_chan_resources failure



When fsl_edma_alloc_chan_resources() fails after clk_prepare_enable(),
the error paths only free IRQs and destroy the TCD pool, but forget to
call clk_disable_unprepare(). This causes the channel clock to remain
enabled, leaking power and resources.

Fix it by disabling the channel clock in the error unwind path.

Fixes: d8d43558 ("dmaengine: fsl-edma: add i.MX8ULP edma support")
Cc: stable@vger.kernel.org
Suggested-by: default avatarFrank Li <Frank.Li@nxp.com>
Signed-off-by: default avatarZhen Ni <zhen.ni@easystack.cn>
Reviewed-by: default avatarFrank Li <Frank.Li@nxp.com>
Link: https://patch.msgid.link/20251014090522.827726-1-zhen.ni@easystack.cn


Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent a1435458
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -873,6 +873,7 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan)
		free_irq(fsl_chan->txirq, fsl_chan);
err_txirq:
	dma_pool_destroy(fsl_chan->tcd_pool);
	clk_disable_unprepare(fsl_chan->clk);

	return ret;
}