]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital...
authorMiaoqian Lin <linmq006@gmail.com>
Mon, 7 Mar 2022 08:45:22 +0000 (08:45 +0000)
committerMark Brown <broonie@kernel.org>
Fri, 11 Mar 2022 13:42:30 +0000 (13:42 +0000)
Fix the missing clk_disable_unprepare() before return
from msm8916_wcd_digital_probe in the error handling case.

Fixes: 177933c6c8c0 ("ASoC: codecs: Add msm8916-wcd digital codec")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20220307084523.28687-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/codecs/msm8916-wcd-digital.c

index fcc10c8bc625951c9ffb12699cf05f3fb6f4b50b..9ad7fc0baf072678b40063b96fa8450738b06d70 100644 (file)
@@ -1201,7 +1201,7 @@ static int msm8916_wcd_digital_probe(struct platform_device *pdev)
        ret = clk_prepare_enable(priv->mclk);
        if (ret < 0) {
                dev_err(dev, "failed to enable mclk %d\n", ret);
-               return ret;
+               goto err_clk;
        }
 
        dev_set_drvdata(dev, priv);
@@ -1209,6 +1209,9 @@ static int msm8916_wcd_digital_probe(struct platform_device *pdev)
        return devm_snd_soc_register_component(dev, &msm8916_wcd_digital,
                                      msm8916_wcd_digital_dai,
                                      ARRAY_SIZE(msm8916_wcd_digital_dai));
+err_clk:
+       clk_disable_unprepare(priv->ahbclk);
+       return ret;
 }
 
 static int msm8916_wcd_digital_remove(struct platform_device *pdev)