Skip to contentSkip to conversation

request for 4.14-stable: 6431a7e36652 ("ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()")

PATCH Sudip Mukherjee 2 participants 2 messages Sep 21, 2018 – Sep 24, 2018

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

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

Quoted 1 line

From efbd13a578a9c714268facde1600c9b5e44a9ab7 Mon Sep 17 00:00:00 2001

From: Christophe Jaillet <[email protected]>
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.")
---
 sound/soc/samsung/i2s.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
sound/soc/samsung/i2s.c +4 -1
index f058f2bdd519..33b4d14af2b3 100644
@@ -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 */
Signature · 1 line
2.11.0
#1 lore raw
Quoted 4 lines · Sudip Mukherjee

Hi Greg,

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

Now applied, thanks.

greg k-h