From: Paul Walmsley <pjw@kernel.org>
To: Zishun Yi <vulab@iscas.ac.cn>
Cc: pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
alex@ghiti.fr, atish.patra@linux.dev, stable@vger.kernel.org
Subject: Re: [PATCH v2] riscv: cacheinfo: Fix node reference leak in populate_cache_leaves
Date: Thu, 21 May 2026 16:50:58 -0600 (MDT) [thread overview]
Message-ID: <58b50dc5-7307-c38d-3cdf-46343052bafe@kernel.org> (raw)
In-Reply-To: <20260509074040.1747800-1-vulab@iscas.ac.cn>
On Sat, 9 May 2026, Zishun Yi wrote:
> Currently, the while loop drops the reference to prev in each iteration.
> If the loop terminates early due to a break, the final of_node_put(np)
> correctly drops the reference to the current node.
>
> However, if the loop terminates naturally because np == NULL, calling
> of_node_put(np) is a no-op. This leaves the last valid node stored in
> prev without its reference dropped, resulting in a node reference leak.
>
> Fix this by changing the final `of_node_put(np)` to `of_node_put(prev)`.
>
> Fixes: 94f9bf118f1e ("RISC-V: Fix of_node_* refcount")
> Cc: stable@vger.kernel.org
> Assisted-by: Gemini:gemini-3.1-pro
> Signed-off-by: Zishun Yi <vulab@iscas.ac.cn>
Thanks, queued for v7.1-rc.
- Paul
prev parent reply other threads:[~2026-05-21 22:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-09 7:40 Zishun Yi
2026-05-21 22:50 ` Paul Walmsley [this message]
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=58b50dc5-7307-c38d-3cdf-46343052bafe@kernel.org \
--to=pjw@kernel.org \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=atish.patra@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/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
Powered by JetHome