Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 00ac982d authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Greg Kroah-Hartman
Browse files

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



commit 6431a7e3 upstream.

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarSudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5e8bf9f2
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -552,8 +552,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
			}

			ret = clk_prepare_enable(i2s->op_clk);
			if (ret)
			if (ret) {
				clk_put(i2s->op_clk);
				i2s->op_clk = NULL;
				goto err;
			}
			i2s->rclk_srcrate = clk_get_rate(i2s->op_clk);

			/* Over-ride the other's */