From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f42.google.com ([209.85.208.42]:44095 "EHLO mail-ed1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388121AbeIUBHL (ORCPT ); Thu, 20 Sep 2018 21:07:11 -0400 Received: by mail-ed1-f42.google.com with SMTP id s10-v6so8773818edb.11 for ; Thu, 20 Sep 2018 12:22:11 -0700 (PDT) Date: Thu, 20 Sep 2018 20:21:56 +0100 From: Sudip Mukherjee To: Greg Kroah-Hartman Cc: stable@vger.kernel.org, Christophe JAILLET , Mark Brown Subject: request for 4.14-stable: 6431a7e36652 ("ASoC: samsung: i2s: Fix error handling path in i2s_set_sysclk()") Message-ID: <20180920192156.esz5whzeyyzmtuff@debian> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="wxk66i4fcdgjbebd" Content-Disposition: inline Sender: stable-owner@vger.kernel.org List-ID: --wxk66i4fcdgjbebd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --wxk66i4fcdgjbebd Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-ASoC-samsung-i2s-Fix-error-handling-path-in-i2s_set_.patch" >>From efbd13a578a9c714268facde1600c9b5e44a9ab7 Mon Sep 17 00:00:00 2001 From: Christophe Jaillet 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 Signed-off-by: Mark Brown Signed-off-by: Sudip Mukherjee --- 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 --wxk66i4fcdgjbebd--