* [PATCH] of: unittest: Fix dup node reference leak in attach_node_and_children()
@ 2026-09-17 12:43 Wentao Liang
0 siblings, 0 replies; only message in thread
From: Wentao Liang @ 2026-09-17 12:43 UTC (permalink / raw)
To: devicetree
Cc: gaurav.minocha.os, grant.likely, linux-kernel, robh, saravanak,
Wentao Liang, stable
of_find_node_by_path() returns a node with an elevated reference count.
When a matching node is found in the live tree the function updates the
node properties and returns without dropping that reference. Add the
missing of_node_put() so the reference is not leaked.
Fixes: ae9304c9d311 ("Adding selftest testdata dynamically into live tree")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/of/unittest.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 4078569a0f96..c4d4c10ceaa2 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -2072,6 +2072,7 @@ static void attach_node_and_children(struct device_node *np)
kfree(full_name);
if (dup) {
update_node_properties(np, dup);
+ of_node_put(dup);
return;
}
--
2.34.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-17 12:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 12:43 [PATCH] of: unittest: Fix dup node reference leak in attach_node_and_children() Wentao Liang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox