public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arch: x86: kernel: Add missing of_node_put() in devicetree.c
@ 2022-06-15 15:03 Liang He
  2022-06-15 15:33 ` Dave Hansen
  2022-06-15 16:26 ` Rob Herring
  0 siblings, 2 replies; 5+ messages in thread
From: Liang He @ 2022-06-15 15:03 UTC (permalink / raw)
  To: tglx, mingo, bp, dave.hansen, x86, hpa, robh, frank.rowand
  Cc: windhl, linux-kernel

In dtb_setup_hpet(), of_find_compatible_node() will return a node
pointer with refcount incremented. We should use of_node_put() when it
is not used anymore.

Signed-off-by: Liang He <windhl@126.com>
---
 arch/x86/kernel/devicetree.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
index 5cd51f25f446..6a386424ddf7 100644
--- a/arch/x86/kernel/devicetree.c
+++ b/arch/x86/kernel/devicetree.c
@@ -120,6 +120,9 @@ static void __init dtb_setup_hpet(void)
 	if (!dn)
 		return;
 	ret = of_address_to_resource(dn, 0, &r);
+	
+	of_node_put(dn);
+	
 	if (ret) {
 		WARN_ON(1);
 		return;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-06-15 16:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-15 15:03 [PATCH] arch: x86: kernel: Add missing of_node_put() in devicetree.c Liang He
2022-06-15 15:33 ` Dave Hansen
2022-06-15 16:22   ` Rob Herring
2022-06-15 16:26 ` Rob Herring
2022-06-15 16:50   ` 和亮

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox