linux/drivers/of
Weigang He 81122fba08 of: fix reference count leak in of_alias_scan()
of_find_node_by_path() returns a device_node with its refcount
incremented. When kstrtoint() fails or dt_alloc() fails, the function
continues to the next iteration without calling of_node_put(), causing
a reference count leak.

Add of_node_put(np) before continue on both error paths to properly
release the device_node reference.

Fixes: 611cad7201 ("dt: add of_alias_scan and of_alias_get_id")
Cc: stable@vger.kernel.org
Signed-off-by: Weigang He <geoffreyhe2@gmail.com>
Link: https://patch.msgid.link/20260117091238.481243-1-geoffreyhe2@gmail.com
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
2026-01-17 10:20:43 -06:00
..
unittest-data
.kunitconfig
Kconfig
Makefile
address.c
base.c of: fix reference count leak in of_alias_scan() 2026-01-17 10:20:43 -06:00
cpu.c
device.c
dynamic.c
empty_root.dts
fdt.c arm64: kdump: Fix elfcorehdr overlap caused by reserved memory processing reorder 2025-12-16 07:59:30 -06:00
fdt_address.c
irq.c
kexec.c
kobj.c
kunit_overlay_test.dtso
module.c
of_kunit_helpers.c
of_numa.c
of_private.h
of_reserved_mem.c
of_test.c
overlay.c
overlay_test.c
pdt.c
platform.c of: platform: Use default match table for /firmware 2026-01-16 19:13:56 -06:00
property.c
resolver.c
unittest.c of: unittest: Fix memory leak in unittest_data_add() 2026-01-02 15:36:37 -06:00