]> git.baikalelectronics.ru Git - kernel.git/commit
dmaengine: lgm: Fix an error handling path in intel_ldma_probe()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sun, 22 May 2022 17:41:05 +0000 (19:41 +0200)
committerVinod Koul <vkoul@kernel.org>
Wed, 6 Jul 2022 05:23:25 +0000 (10:53 +0530)
commita6e72512aa70d3addeb32fc33712f588dde8441e
tree45a7a7f7c95641bb881364c5dfeaf24728efc1b8
parent989d8ffa2393b3e9954d6f84538faf78e13d8ef8
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: 17c0f4abca14 ("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>
drivers/dma/lgm/lgm-dma.c