Skip to content

Commit ce35825

Browse files
nizhen-tgregkh
authored andcommitted
dmaengine: fsl-edma: Fix clk leak on alloc_chan_resources failure
[ Upstream commit b18cd8b ] 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: d8d4355 ("dmaengine: fsl-edma: add i.MX8ULP edma support") Cc: stable@vger.kernel.org Suggested-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Zhen Ni <zhen.ni@easystack.cn> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://patch.msgid.link/20251014090522.827726-1-zhen.ni@easystack.cn Signed-off-by: Vinod Koul <vkoul@kernel.org> [ Different error handling scheme ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 027d42b commit ce35825

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/dma/fsl-edma-common.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan)
819819

820820
if (ret) {
821821
dma_pool_destroy(fsl_chan->tcd_pool);
822+
clk_disable_unprepare(fsl_chan->clk);
822823
return ret;
823824
}
824825
}

0 commit comments

Comments
 (0)