public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jerome Brunet <jbrunet@baylibre.com>
To: Pavel Machek <pavel@ucw.cz>,
	lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz,
	tiwai@suse.com, khilman@baylibre.com,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sound/soc/meson: fix irq leak in error path
Date: Mon, 09 Mar 2020 17:46:20 +0100	[thread overview]
Message-ID: <1jeeu14gtf.fsf@starbuckisacylon.baylibre.com> (raw)
In-Reply-To: <20200309162912.GA21498@amd>


On Mon 09 Mar 2020 at 17:29, Pavel Machek <pavel@ucw.cz> wrote:

> Irq seems to be leaked in error path. Fix that.
>

Thanks for fixing this.

the Fixes tag is missing here.
Fixes: 6dc4fa179fb8 ("ASoC: meson: add axg fifo base driver")

> Signed-off-by: Pavel Machek <pavel@denx.de>
>
> ---
>
> I noticed problem during -stable review, and don't have hardware or
> ability to test the patch. Handle with care.
>
> diff --git a/sound/soc/meson/axg-fifo.c b/sound/soc/meson/axg-fifo.c
> index 2f44e93359f6..fbac6de891cd 100644
> --- a/sound/soc/meson/axg-fifo.c
> +++ b/sound/soc/meson/axg-fifo.c
> @@ -249,7 +249,7 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
>  	/* Enable pclk to access registers and clock the fifo ip */
>  	ret = clk_prepare_enable(fifo->pclk);
>  	if (ret)
> -		return ret;
> +		goto free_irq;
>  
>  	/* Setup status2 so it reports the memory pointer */
>  	regmap_update_bits(fifo->map, FIFO_CTRL1,
> @@ -270,8 +269,14 @@ int axg_fifo_pcm_open(struct snd_soc_component *component,
>  	/* Take memory arbitror out of reset */
>  	ret = reset_control_deassert(fifo->arb);
>  	if (ret)
> -		clk_disable_unprepare(fifo->pclk);
> +		goto free_clk;
> +
> +	return 0;
>  
> +free_clk:

This label is misleading as it won't free the clock but turn it off.
how about 'err_rst' ?

> +	clk_disable_unprepare(fifo->pclk);
> +free_irq:

and 'err_pclk' here ?

> +	free_irq(fifo->irq, ss);
>  	return ret;
>  }
>  EXPORT_SYMBOL_GPL(axg_fifo_pcm_open);


  reply	other threads:[~2020-03-09 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-09 16:29 [PATCH] sound/soc/meson: fix irq leak in error path Pavel Machek
2020-03-09 16:46 ` Jerome Brunet [this message]
2020-03-09 16:59 ` Mark Brown

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=1jeeu14gtf.fsf@starbuckisacylon.baylibre.com \
    --to=jbrunet@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=khilman@baylibre.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=perex@perex.cz \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox