linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: "Krzysztof Hałasa" <khalasa@piap.pl>
To: Miaoqian Lin <linmq006@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>,
	 Arnd Bergmann <arnd@arndb.de>,
	linux-arm-kernel@lists.infradead.org,
	 linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: cns3xxx: Fix refcount leak in cns3xxx_init
Date: Thu, 23 Jun 2022 10:36:07 +0200	[thread overview]
Message-ID: <m3wnd76ako.fsf@t19.piap.pl> (raw)
In-Reply-To: <20220605075841.19929-1-linmq006@gmail.com> (Miaoqian Lin's message of "Sun, 5 Jun 2022 11:58:41 +0400")

Miaoqian Lin <linmq006@gmail.com> writes:

> of_find_compatible_node() returns a node pointer with refcount
> incremented, we should use of_node_put() on it when done.
> Add missing of_node_put() to avoid refcount leak.
>
> Fixes: 415f59142d9d ("ARM: cns3xxx: initial DT support")
> Signed-off-by: Miaoqian Lin <linmq006@gmail.com>

Acked-by: Krzysztof Halasa <khalasa@piap.pl>

Arnd, I guess you are in the best position to pick this patch up?
Thanks to both of you.

> ---
>  arch/arm/mach-cns3xxx/core.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/mach-cns3xxx/core.c b/arch/arm/mach-cns3xxx/core.c
> index e4f4b20b83a2..3fc4ec830e3a 100644
> --- a/arch/arm/mach-cns3xxx/core.c
> +++ b/arch/arm/mach-cns3xxx/core.c
> @@ -372,6 +372,7 @@ static void __init cns3xxx_init(void)
>  		/* De-Asscer SATA Reset */
>  		cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SATA));
>  	}
> +	of_node_put(dn);
>  
>  	dn = of_find_compatible_node(NULL, NULL, "cavium,cns3420-sdhci");
>  	if (of_device_is_available(dn)) {
> @@ -385,6 +386,7 @@ static void __init cns3xxx_init(void)
>  		cns3xxx_pwr_clk_en(CNS3XXX_PWR_CLK_EN(SDIO));
>  		cns3xxx_pwr_soft_rst(CNS3XXX_PWR_SOFTWARE_RST(SDIO));
>  	}
> +	of_node_put(dn);
>  
>  	pm_power_off = cns3xxx_power_off;

-- 
Krzysztof "Chris" Hałasa

Sieć Badawcza Łukasiewicz
Przemysłowy Instytut Automatyki i Pomiarów PIAP
Al. Jerozolimskie 202, 02-486 Warszawa

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

  reply	other threads:[~2022-06-23  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05  7:58 [PATCH] ARM: cns3xxx: Fix refcount leak in cns3xxx_init Miaoqian Lin
2022-06-23  8:36 ` Krzysztof Hałasa [this message]
2022-06-24 15:11   ` Arnd Bergmann

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=m3wnd76ako.fsf@t19.piap.pl \
    --to=khalasa@piap.pl \
    --cc=arnd@arndb.de \
    --cc=linmq006@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    /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).