Skip to content

Commit 1dbe67b

Browse files
tititiou36vinodkoul
authored andcommitted
dmaengine: lgm: Fix an error handling path in intel_ldma_probe()
ldma_clk_disable() calls both: clk_disable_unprepare(d->core_clk); reset_control_assert(d->rst); So, should devm_reset_control_get_optional() fail, core_clk should not be prepare_enable'd before it, otherwise it will never be disable_unprepare'd. Reorder the code to handle the error handling path as expected. Fixes: 32d31c7 ("dmaengine: Add Intel LGM SoC DMA support.") Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/18504549bc4d2b62a72a02cb22a2e4d8e6a58720.1653241224.git.christophe.jaillet@wanadoo.fr Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent b64b3b2 commit 1dbe67b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/dma/lgm/lgm-dma.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,11 +1593,12 @@ static int intel_ldma_probe(struct platform_device *pdev)
15931593
d->core_clk = devm_clk_get_optional(dev, NULL);
15941594
if (IS_ERR(d->core_clk))
15951595
return PTR_ERR(d->core_clk);
1596-
clk_prepare_enable(d->core_clk);
15971596

15981597
d->rst = devm_reset_control_get_optional(dev, NULL);
15991598
if (IS_ERR(d->rst))
16001599
return PTR_ERR(d->rst);
1600+
1601+
clk_prepare_enable(d->core_clk);
16011602
reset_control_deassert(d->rst);
16021603

16031604
ret = devm_add_action_or_reset(dev, ldma_clk_disable, d);

0 commit comments

Comments
 (0)