提交 6431a7e3 编写于 作者: C Christophe Jaillet 提交者: Mark Brown

ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()

If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock.
Othewise, there is a resource leak.

Fixes: f5c97c7b ("ASoC: samsung: i2s: Handle return value of clk_prepare_enable.")
Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: NMark Brown <broonie@kernel.org>
上级 1107a293
...@@ -552,8 +552,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai, ...@@ -552,8 +552,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
} }
ret = clk_prepare_enable(i2s->op_clk); ret = clk_prepare_enable(i2s->op_clk);
if (ret) if (ret) {
clk_put(i2s->op_clk);
i2s->op_clk = NULL;
goto err; goto err;
}
i2s->rclk_srcrate = clk_get_rate(i2s->op_clk); i2s->rclk_srcrate = clk_get_rate(i2s->op_clk);
/* Over-ride the other's */ /* Over-ride the other's */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册