sparclinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: jackysliu <1972843537@qq.com>, markus.elfring@web.de
Cc: andreas@gaisler.com, davem@davemloft.net,
	linux-kernel@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH v3] sparc: fix resource leak in jbusmc_probe()
Date: Tue, 22 Jul 2025 08:22:10 +0200	[thread overview]
Message-ID: <0fcc2727-b911-48b5-9aa1-17fb484c6b07@kernel.org> (raw)
In-Reply-To: <tencent_46DA24BE77C8E62514B3346C5CDBDB327F07@qq.com>

On 21/07/2025 09:55, jackysliu wrote:
> From: Siyang Liu <1972843537@qq.com>
> 
> In the jbusmc_probe function, the device node mem_node fetched
> via of_find_node_by_path("/memory") is not properly freed
> on all code paths.
> This can lead to leakage of device node reference counts,
> which may result in kernel resources not being released.
> 
> This issue was detected by rule based static tools
> developed by Tencent.
> 
> Fixes: e70140ba0d2b ("Get rid of 'remove_new' relic from platform driver struct")
> 
> Signed-off-by: Siyang Liu <1972843537@qq.com>
> ---
>  arch/sparc/kernel/chmc.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/sparc/kernel/chmc.c b/arch/sparc/kernel/chmc.c
> index d4c74d6b2e1b..fd20e4ee0971 100644
> --- a/arch/sparc/kernel/chmc.c
> +++ b/arch/sparc/kernel/chmc.c
> @@ -412,7 +412,7 @@ static int jbusmc_probe(struct platform_device *op)
>  	mem_regs = of_get_property(mem_node, "reg", &len);
>  	if (!mem_regs) {
>  		printk(KERN_ERR PFX "Cannot get reg property of /memory node.\n");
> -		goto out;
> +		goto out_put;

Nothing improved. You just ignored all the comments.

Best regards,
Krzysztof

  parent reply	other threads:[~2025-07-22  6:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-18  9:22 [PATCH] arch: fix resource leak in chmc.c Jacky Liu
2025-07-18 13:25 ` Krzysztof Kozlowski
2025-07-21  2:04   ` jackysliu
2025-07-18 13:43 ` [PATCH] " Markus Elfring
2025-07-21  3:57   ` [PATCH v2] arch: fix resource leak in jbusmc_probe() jackysliu
2025-07-21  7:18     ` Markus Elfring
2025-07-21  7:55       ` [PATCH v3] sparc: " jackysliu
2025-07-21  8:17         ` Markus Elfring
2025-07-22  6:22         ` Krzysztof Kozlowski [this message]
2025-07-21  8:25     ` [PATCH v2] arch: " Krzysztof Kozlowski

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=0fcc2727-b911-48b5-9aa1-17fb484c6b07@kernel.org \
    --to=krzk@kernel.org \
    --cc=1972843537@qq.com \
    --cc=andreas@gaisler.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.elfring@web.de \
    --cc=sparclinux@vger.kernel.org \
    /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).