All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Banajit Goswami <bgoswami@codeaurora.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
	Takashi Iwai <tiwai@suse.com>,
	alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital_probe
Date: Sun, 3 Apr 2022 07:51:41 +0200	[thread overview]
Message-ID: <93751991-30ce-93a0-0f33-105f99b8dfe3@wanadoo.fr> (raw)
In-Reply-To: <20220307084523.28687-1-linmq006@gmail.com>

Le 07/03/2022 à 09:45, Miaoqian Lin a écrit :
> Fix the missing clk_disable_unprepare() before return
> from msm8916_wcd_digital_probe in the error handling case.
> 
> Fixes: 150db8c5afa1 ("ASoC: codecs: Add msm8916-wcd digital codec")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>   sound/soc/codecs/msm8916-wcd-digital.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
> index fcc10c8bc625..9ad7fc0baf07 100644
> --- a/sound/soc/codecs/msm8916-wcd-digital.c
> +++ b/sound/soc/codecs/msm8916-wcd-digital.c
> @@ -1201,7 +1201,7 @@ static int msm8916_wcd_digital_probe(struct platform_device *pdev)
>   	ret = clk_prepare_enable(priv->mclk);
>   	if (ret < 0) {
>   		dev_err(dev, "failed to enable mclk %d\n", ret);
> -		return ret;
> +		goto err_clk;
>   	}
>   
>   	dev_set_drvdata(dev, priv);
> @@ -1209,6 +1209,9 @@ static int msm8916_wcd_digital_probe(struct platform_device *pdev)
>   	return devm_snd_soc_register_component(dev, &msm8916_wcd_digital,
>   				      msm8916_wcd_digital_dai,
>   				      ARRAY_SIZE(msm8916_wcd_digital_dai));
> +err_clk:
> +	clk_disable_unprepare(priv->ahbclk);
> +	return ret;
>   }
>   
>   static int msm8916_wcd_digital_remove(struct platform_device *pdev)

Hi,
I think that the same should be done for 'priv->mclk' if 
devm_snd_soc_register_component() returns an error.

Can you give it a look?

CJ

WARNING: multiple messages have this Message-ID (diff)
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: alsa-devel@alsa-project.org,
	Banajit Goswami <bgoswami@codeaurora.org>,
	linux-kernel@vger.kernel.org, Takashi Iwai <tiwai@suse.com>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Mark Brown <broonie@kernel.org>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Subject: Re: [PATCH] ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital_probe
Date: Sun, 3 Apr 2022 07:51:41 +0200	[thread overview]
Message-ID: <93751991-30ce-93a0-0f33-105f99b8dfe3@wanadoo.fr> (raw)
In-Reply-To: <20220307084523.28687-1-linmq006@gmail.com>

Le 07/03/2022 à 09:45, Miaoqian Lin a écrit :
> Fix the missing clk_disable_unprepare() before return
> from msm8916_wcd_digital_probe in the error handling case.
> 
> Fixes: 150db8c5afa1 ("ASoC: codecs: Add msm8916-wcd digital codec")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
> ---
>   sound/soc/codecs/msm8916-wcd-digital.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
> index fcc10c8bc625..9ad7fc0baf07 100644
> --- a/sound/soc/codecs/msm8916-wcd-digital.c
> +++ b/sound/soc/codecs/msm8916-wcd-digital.c
> @@ -1201,7 +1201,7 @@ static int msm8916_wcd_digital_probe(struct platform_device *pdev)
>   	ret = clk_prepare_enable(priv->mclk);
>   	if (ret < 0) {
>   		dev_err(dev, "failed to enable mclk %d\n", ret);
> -		return ret;
> +		goto err_clk;
>   	}
>   
>   	dev_set_drvdata(dev, priv);
> @@ -1209,6 +1209,9 @@ static int msm8916_wcd_digital_probe(struct platform_device *pdev)
>   	return devm_snd_soc_register_component(dev, &msm8916_wcd_digital,
>   				      msm8916_wcd_digital_dai,
>   				      ARRAY_SIZE(msm8916_wcd_digital_dai));
> +err_clk:
> +	clk_disable_unprepare(priv->ahbclk);
> +	return ret;
>   }
>   
>   static int msm8916_wcd_digital_remove(struct platform_device *pdev)

Hi,
I think that the same should be done for 'priv->mclk' if 
devm_snd_soc_register_component() returns an error.

Can you give it a look?

CJ

  parent reply	other threads:[~2022-04-03  5:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-07  8:45 [PATCH] ASoC: msm8916-wcd-digital: Fix missing clk_disable_unprepare() in msm8916_wcd_digital_probe Miaoqian Lin
2022-03-11 20:22 ` Mark Brown
2022-04-03  5:51 ` Christophe JAILLET [this message]
2022-04-03  5:51   ` Christophe JAILLET
2022-04-03  7:15   ` 林妙倩
2022-04-03  9:12     ` Christophe JAILLET
2022-04-03  9:12       ` Christophe JAILLET

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=93751991-30ce-93a0-0f33-105f99b8dfe3@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=alsa-devel@alsa-project.org \
    --cc=bgoswami@codeaurora.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linmq006@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=tiwai@suse.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.