linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: zpershuai <zpershuai@gmail.com>, Mark Brown <broonie@kernel.org>,
	Kevin Hilman <khilman@baylibre.com>,
	Jerome Brunet <jbrunet@baylibre.com>,
	Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
	linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] spi: meson-spicc: fix a wrong goto jump for avoiding memory leak.
Date: Mon, 14 Jun 2021 15:08:46 +0200	[thread overview]
Message-ID: <b3ea2ad6-6341-df56-9d09-e3e832f8f316@baylibre.com> (raw)
In-Reply-To: <1623562172-22056-1-git-send-email-zpershuai@gmail.com>

Hi,

On 13/06/2021 07:29, zpershuai wrote:
> In meson_spifc_probe function, when enable the device pclk clock is
> error, it should use clk_disable_unprepare to release the core clock.
> 
> Signed-off-by: zpershuai <zpershuai@gmail.com>
> ---
>  drivers/spi/spi-meson-spicc.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/spi/spi-meson-spicc.c b/drivers/spi/spi-meson-spicc.c
> index d675334..b2c4621 100644
> --- a/drivers/spi/spi-meson-spicc.c
> +++ b/drivers/spi/spi-meson-spicc.c
> @@ -725,7 +725,7 @@ static int meson_spicc_probe(struct platform_device *pdev)
>  	ret = clk_prepare_enable(spicc->pclk);
>  	if (ret) {
>  		dev_err(&pdev->dev, "pclk clock enable failed\n");
> -		goto out_master;
> +		goto out_core_clk;
>  	}
>  
>  	device_reset_optional(&pdev->dev);
> @@ -764,9 +764,11 @@ static int meson_spicc_probe(struct platform_device *pdev)
>  	return 0;
>  
>  out_clk:
> -	clk_disable_unprepare(spicc->core);
>  	clk_disable_unprepare(spicc->pclk);
>  
> +out_core_clk:
> +	clk_disable_unprepare(spicc->core);
> +
>  out_master:
>  	spi_master_put(master);
>  
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

  reply	other threads:[~2021-06-14 13:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-13  5:29 [PATCH v2 2/2] spi: meson-spicc: fix a wrong goto jump for avoiding memory leak zpershuai
2021-06-14 13:08 ` Neil Armstrong [this message]
2021-06-14 19:53 ` 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=b3ea2ad6-6341-df56-9d09-e3e832f8f316@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=broonie@kernel.org \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=martin.blumenstingl@googlemail.com \
    --cc=zpershuai@gmail.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;
as well as URLs for NNTP newsgroup(s).