Skip to content

Commit 2e1368a

Browse files
UuuuuuhoThomas Gleixner
authored andcommitted
irqchip/gic-v3-its: Fix OF node reference leak
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: fbf8f40 ("irqchip/gicv3-its: numa: Enable workaround for Cavium thunderx erratum 23144") Signed-off-by: Yuho Choi <dbgh9129@gmail.com> Signed-off-by: Thomas Gleixner <tglx@kernel.org> Reviewed-by: Zenghui Yu (Huawei) <zenghui.yu@linux.dev> Acked-by: Marc Zyngier <maz@kernel.org>
1 parent 1358126 commit 2e1368a

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/irqchip/irq-gic-v3-its.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3290,11 +3290,9 @@ static void its_cpu_init_collection(struct its_node *its)
32903290

32913291
/* avoid cross node collections and its mapping */
32923292
if (its->flags & ITS_FLAGS_WORKAROUND_CAVIUM_23144) {
3293-
struct device_node *cpu_node;
3293+
struct device_node *cpu_node __free(device_node) = of_get_cpu_node(cpu, NULL);
32943294

3295-
cpu_node = of_get_cpu_node(cpu, NULL);
3296-
if (its->numa_node != NUMA_NO_NODE &&
3297-
its->numa_node != of_node_to_nid(cpu_node))
3295+
if (its->numa_node != NUMA_NO_NODE && its->numa_node != of_node_to_nid(cpu_node))
32983296
return;
32993297
}
33003298

0 commit comments

Comments
 (0)