* [PATCH] of: unittest: Fix of_symbols reference leak in of_unittest_overlay_high_level()
@ 2026-09-17 12:57 Wentao Liang
2026-09-18 11:41 ` Krzysztof Kozlowski
0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-09-17 12:57 UTC (permalink / raw)
To: devicetree
Cc: frowand.list, linux-kernel, robh, saravanak, Wentao Liang, stable
of_get_child_by_name() returns a node with an elevated reference count,
but the function never drops it: neither on the early return for an
illegal node name, nor on the normal return, nor on the err_unlock
path. Add the missing of_node_put() calls.
Fixes: 81d0848fc8d2 ("of: Add unit tests for applying overlays")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
drivers/of/unittest.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 900840850814..36c64d485a53 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -4091,6 +4091,7 @@ static __init void of_unittest_overlay_high_level(void)
np);
of_node_put(np);
of_node_put(base_child);
+ of_node_put(of_symbols);
return;
}
}
@@ -4289,10 +4290,13 @@ static __init void of_unittest_overlay_high_level(void)
EXPECT_END(KERN_ERR,
"OF: resolver: node label 'this_label_does_not_exist' not found in live devicetree symbols table");
+ of_node_put(of_symbols);
+
return;
err_unlock:
mutex_unlock(&of_mutex);
+ of_node_put(of_symbols);
}
static int of_unittest_pci_dev_num;
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] of: unittest: Fix of_symbols reference leak in of_unittest_overlay_high_level()
2026-09-17 12:57 [PATCH] of: unittest: Fix of_symbols reference leak in of_unittest_overlay_high_level() Wentao Liang
@ 2026-09-18 11:41 ` Krzysztof Kozlowski
0 siblings, 0 replies; 2+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-18 11:41 UTC (permalink / raw)
To: Wentao Liang
Cc: devicetree, frowand.list, linux-kernel, robh, saravanak, stable
On Thu, Sep 17, 2026 at 12:57:17PM +0000, Wentao Liang wrote:
> of_get_child_by_name() returns a node with an elevated reference count,
> but the function never drops it: neither on the early return for an
> illegal node name, nor on the normal return, nor on the err_unlock
> path. Add the missing of_node_put() calls.
>
> Fixes: 81d0848fc8d2 ("of: Add unit tests for applying overlays")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Why are you sending 10 separate patches, one by one, not a proper
patchset? It's the same as with Guangshuo Li.
Look:
https://lore.kernel.org/all/?q=f%3AWentao+Liang+%3Cvulab%40iscas.ac.cn%3E
Absolutely nothing is threaded. No way for a subsystem maintainer to for
example drop one comment for entire subsystem. Instead you ask
maintainer to reply TO EACH of the patches.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-18 11:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 12:57 [PATCH] of: unittest: Fix of_symbols reference leak in of_unittest_overlay_high_level() Wentao Liang
2026-09-18 11:41 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®