From: Zenghui Yu <zenghui.yu@linux.dev>
To: Yuho Choi <dbgh9129@gmail.com>
Cc: Marc Zyngier <maz@kernel.org>, Thomas Gleixner <tglx@kernel.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3] irqchip/gic-v3-its: Fix OF node reference leak
Date: Mon, 29 Jun 2026 20:19:32 +0800 [thread overview]
Message-ID: <0547a4b7-8f6a-4516-8cdd-a308ae9bf579@linux.dev> (raw)
In-Reply-To: <20260628220723.1699972-1-dbgh9129@gmail.com>
On 6/29/26 6:07 AM, Yuho Choi wrote:
> of_get_cpu_node() returns a referenced device node. In
> its_cpu_init_collection(), the Cavium 23144 workaround only uses the
> node to compare the CPU NUMA node, but the reference is never dropped.
>
> Use the device_node cleanup helper for the CPU node reference so it is
> released when leaving the workaround block, including the NUMA mismatch
> return path.
>
> Fixes: fbf8f40e1658 ("irqchip/gicv3-its: numa: Enable workaround for Cavium thunderx erratum 23144")
> Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
> Acked-by: Marc Zyngier <maz@kernel.org>
> ---
> Changes in v3:
> - Keep the __free(device_node) assignment on a single line.
> - Fix indentation in the Cavium 23144 workaround block.
> - Add Marc's Acked-by.
> Changes in v2:
> - Use __free(device_node) for the CPU node reference.
> - Correct the Fixes tag to fbf8f40e1658.
> drivers/irqchip/irq-gic-v3-its.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index b57d81ad33a0..6f5811aae59c 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -3290,11 +3290,9 @@ static void its_cpu_init_collection(struct its_node *its)
>
> /* avoid cross node collections and its mapping */
> if (its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) {
> - struct device_node *cpu_node;
> + struct device_node *cpu_node __free(device_node) = of_get_cpu_node(cpu, NULL);
>
> - cpu_node = of_get_cpu_node(cpu, NULL);
> - if (its->numa_node != NUMA_NO_NODE &&
> - its->numa_node != of_node_to_nid(cpu_node))
> + if (its->numa_node != NUMA_NO_NODE && its->numa_node != of_node_to_nid(cpu_node))
> return;
> }
Reviewed-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev>
Thanks,
Zenghui
prev parent reply other threads:[~2026-06-29 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-28 22:07 [PATCH v3] irqchip/gic-v3-its: Fix OF node reference leak Yuho Choi
2026-06-29 12:19 ` Zenghui Yu [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=0547a4b7-8f6a-4516-8cdd-a308ae9bf579@linux.dev \
--to=zenghui.yu@linux.dev \
--cc=dbgh9129@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=maz@kernel.org \
--cc=tglx@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