From: Aravind Anilraj <aravindanilraj0702@gmail.com>
If byt_rt5651_prepare_and_enable_pll1() fails, the function returns
without calling clk_disable_unprepare() on priv->mclk, which was
already enabled earlier in the same code path. Add the missing
clk_disable_unprepare() call before returning the error.
Signed-off-by: Aravind Anilraj <aravindanilraj0702@gmail.com>
---
sound/soc/intel/boards/bytcr_rt5651.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
index 68cf463f1d50..e2f59a008b29 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -209,6 +209,9 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
return ret;
}
ret = byt_rt5651_prepare_and_enable_pll1(codec_dai, 48000, 50);
+ if (ret < 0) {
+ clk_disable_unprepare(priv->mclk);
+ }
} else {
/*
* Set codec clock source to internal clock before
--
2.47.3