If snd_soc_dai_set_pll() or snd_soc_dai_set_sysclk() fail inside the EVENT_ON path, the function returns without calling clk_disable_unprepare() on ctx->mclk, which was already enabled earlier in the same code path. Add the missing clk_disable_unprepare() calls before returning the error.
Unified · Split
| @@ -77,6 +77,8 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, · 76 unmodified lines | |||
| 77 | CHT_PLAT_CLK_3_HZ, 48000 * 512); | 77 | CHT_PLAT_CLK_3_HZ, 48000 * 512); |
| 78 | if (ret < 0) { | 78 | if (ret < 0) { |
| 79 | dev_err(card->dev, "can't set codec pll: %d\n", ret); | 79 | dev_err(card->dev, "can't set codec pll: %d\n", ret); |
| 80 | if (ctx->mclk) | ||
| 81 | clk_disable_unprepare(ctx->mclk); | ||
| 80 | return ret; | 82 | return ret; |
| 81 | } | 83 | } |
| 82 | 84 | ||
| @@ -85,6 +87,8 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w, · 2 unmodified lines | |||
| 85 | 48000 * 512, SND_SOC_CLOCK_IN); | 87 | 48000 * 512, SND_SOC_CLOCK_IN); |
| 86 | if (ret < 0) { | 88 | if (ret < 0) { |
| 87 | dev_err(card->dev, "can't set codec sysclk: %d\n", ret); | 89 | dev_err(card->dev, "can't set codec sysclk: %d\n", ret); |
| 90 | if (ctx->mclk) | ||
| 91 | clk_disable_unprepare(ctx->mclk); | ||
| 88 | return ret; | 92 | return ret; |
| 89 | } | 93 | } |
| 90 | } else { | 94 | } else { |