]> git.baikalelectronics.ru Git - kernel.git/commit
ASoC: da7219: Fix an error handling path in da7219_register_dai_clks()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 22 Sep 2022 19:44:57 +0000 (21:44 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 23 Sep 2022 16:54:15 +0000 (17:54 +0100)
commitd3e7d8d48a69e7e159e25dd15fae4a7082e60243
tree37dba50563406f4ecf55ea971f6fee51cab4af31
parentaa71923c689f2f653d9312991324ee1f8abd5adf
ASoC: da7219: Fix an error handling path in da7219_register_dai_clks()

If clk_hw_register() fails, the corresponding clk should not be
unregistered.

To handle errors from loops, clean up partial iterations before doing the
goto.  So add a clk_hw_unregister().
Then use a while (--i >= 0) loop in the unwind section.

Fixes: 22981c177514 ("ASoC: da7219: Fix clock handling around codec level probe")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/e4acceab57a0d9e477a8d5890a45c5309e553e7c.1663875789.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/da7219.c