public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* request for 4.14-stable: 6431a7e36652 ("ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()")
@ 2018-09-20 19:21 Sudip Mukherjee
  2018-09-24 10:58 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2018-09-20 19:21 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: stable, Christophe JAILLET, Mark Brown

[-- Attachment #1: Type: text/plain, Size: 136 bytes --]

Hi Greg,

This was not marked for stable but seems it should be in stable.
Please apply to your queue of 4.14-stable.

--
Regards
Sudip

[-- Attachment #2: 0001-ASoC-samsung-i2s-Fix-error-handling-path-in-i2s_set_.patch --]
[-- Type: text/x-diff, Size: 1247 bytes --]

>From efbd13a578a9c714268facde1600c9b5e44a9ab7 Mon Sep 17 00:00:00 2001
From: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Date: Sun, 3 Sep 2017 14:29:02 +0200
Subject: [PATCH] ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()

commit 6431a7e36652517df82855ee79c8240001812a55 upstream

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

Fixes: f5c97c7b0438 ("ASoC: samsung: i2s: Handle return value of clk_prepare_enable.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 sound/soc/samsung/i2s.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c
index f058f2bdd519..33b4d14af2b3 100644
--- a/sound/soc/samsung/i2s.c
+++ b/sound/soc/samsung/i2s.c
@@ -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 */
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-09-24 17:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-20 19:21 request for 4.14-stable: 6431a7e36652 ("ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()") Sudip Mukherjee
2018-09-24 10:58 ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox