Skip to content

Commit 00ac982

Browse files
tititiou36gregkh
authored andcommitted
ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()
commit 6431a7e upstream. If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock. Othewise, there is a resource leak. Fixes: f5c97c7 ("ASoC: samsung: i2s: Handle return value of clk_prepare_enable.") Signed-off-by: Christophe JAILLET <[email protected]> Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5e8bf9f commit 00ac982

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sound/soc/samsung/i2s.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,11 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
552552
}
553553

554554
ret = clk_prepare_enable(i2s->op_clk);
555-
if (ret)
555+
if (ret) {
556+
clk_put(i2s->op_clk);
557+
i2s->op_clk = NULL;
556558
goto err;
559+
}
557560
i2s->rclk_srcrate = clk_get_rate(i2s->op_clk);
558561

559562
/* Over-ride the other's */

0 commit comments

Comments
 (0)