lkml.org 
[lkml]   [2022]   [Apr]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ARM: highbank: Fix missing of_node_put in highbank_init()
Date
From: Lv Ruyi <lv.ruyi@zte.com.cn>

of_find_compatible_node() returns node pointer with refcount incremented,
use of_node_put() on it to decrease refcount when done.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
arch/arm/mach-highbank/highbank.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/arch/arm/mach-highbank/highbank.c b/arch/arm/mach-highbank/highbank.c
index db607955a7e4..fe82c3d16ffd 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -141,6 +141,7 @@ static void __init highbank_init(void)
/* Map system registers */
np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs");
sregs_base = of_iomap(np, 0);
+ of_node_put(np);
WARN_ON(!sregs_base);

pm_power_off = highbank_power_off;
--
2.25.1
\
 
 \ /
  Last update: 2022-04-08 11:49    [W:0.038 / U:0.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site