Skip to content

Commit b18cd8b

Browse files
nizhen-tvinodkoul
authored andcommitted
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: d8d4355 ("dmaengine: fsl-edma: add i.MX8ULP edma support") Cc: [email protected] Suggested-by: Frank Li <[email protected]> Signed-off-by: Zhen Ni <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent a143545 commit b18cd8b

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
@@ -873,6 +873,7 @@ int fsl_edma_alloc_chan_resources(struct dma_chan *chan)
873873
free_irq(fsl_chan->txirq, fsl_chan);
874874
err_txirq:
875875
dma_pool_destroy(fsl_chan->tcd_pool);
876+
clk_disable_unprepare(fsl_chan->clk);
876877

877878
return ret;
878879
}

0 commit comments

Comments
 (0)