lkml.org 
[lkml]   [2022]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] arch: x86: kernel: Add missing of_node_put() in devicetree.c
Date
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
\
 
 \ /
  Last update: 2022-06-15 17:05    [W:0.405 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site