public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Liang He <windhl@126.com>,
	khilman@baylibre.com, jbrunet@baylibre.com,
	martin.blumenstingl@googlemail.com
Cc: linux-arm-kernel@lists.infradead.org,
	linux-amlogic@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] soc: amlogic: Fix refcount leak in meson-secure-pwrc.c
Date: Fri, 17 Jun 2022 09:31:13 +0200	[thread overview]
Message-ID: <54e1434d-e517-9283-3078-7f042c04385b@baylibre.com> (raw)
In-Reply-To: <20220616144915.3988071-1-windhl@126.com>

On 16/06/2022 16:49, Liang He wrote:
> In meson_secure_pwrc_probe(), there is a refcount leak in one fail
> path.
> 
> Signed-off-by: Liang He <windhl@126.com>
Fixes: b3dde5013e13 ("soc: amlogic: Add support for Secure power domains controller")
> ---
>   drivers/soc/amlogic/meson-secure-pwrc.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/soc/amlogic/meson-secure-pwrc.c b/drivers/soc/amlogic/meson-secure-pwrc.c
> index a10a417a87db..e93518763526 100644
> --- a/drivers/soc/amlogic/meson-secure-pwrc.c
> +++ b/drivers/soc/amlogic/meson-secure-pwrc.c
> @@ -152,8 +152,10 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
>   	}
>   
>   	pwrc = devm_kzalloc(&pdev->dev, sizeof(*pwrc), GFP_KERNEL);
> -	if (!pwrc)
> +	if (!pwrc) {
> +		of_node_put(sm_np);
>   		return -ENOMEM;
> +	}
>   
>   	pwrc->fw = meson_sm_get(sm_np);
>   	of_node_put(sm_np);


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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-06-17  7:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16 14:49 [PATCH] soc: amlogic: Fix refcount leak in meson-secure-pwrc.c Liang He
2022-06-16 20:17 ` Martin Blumenstingl
2022-06-17  1:22   ` Liang He
2022-06-17  7:31 ` Neil Armstrong [this message]
2022-06-17  7:41 ` Neil Armstrong

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=54e1434d-e517-9283-3078-7f042c04385b@baylibre.com \
    --to=narmstrong@baylibre.com \
    --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=martin.blumenstingl@googlemail.com \
    --cc=windhl@126.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