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 v2] arch: fix resource leak in jbusmc_probe()
Date: Mon, 21 Jul 2025 10:25:28 +0200 [thread overview]
Message-ID: <425fd8a4-2a91-4755-a9fe-eef679b92f9e@kernel.org> (raw)
In-Reply-To: <tencent_60B856B729FE434916EF57CDF5286D69A008@qq.com>
On 21/07/2025 05:57, 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.
Please wrap commit message according to Linux coding style / submission
process (neither too early nor over the limit):
https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/process/submitting-patches.rst#L597
Do not attach (thread) your patchsets to some other threads (unrelated
or older versions). This buries them deep in the mailbox and might
interfere with applying entire sets.
>
> This issue was detected by rule based static tools
> developed by Tencent.
What tools? This must be specific, give their name.
Previously Tencent reports were often bogus or low quality.
>
> 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;
You did not implement at all what I asked. I wanted the code to be
simpler, you just made it more complicated. Read again previous feedback.
Best regards,
Krzysztof
next prev parent reply other threads:[~2025-07-21 8:25 UTC|newest]
Thread overview: 11+ 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
2025-07-21 8:25 ` Krzysztof Kozlowski [this message]
2025-07-21 3:49 [PATCH] dm-raid: do not include dm-core.h Pavel Tikhomirov
2025-07-21 3:56 ` [PATCH v2] arch: fix resource leak in jbusmc_probe() jackysliu
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=425fd8a4-2a91-4755-a9fe-eef679b92f9e@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
all inboxes | Powered by JetHome®