lkml.org 
[lkml]   [2022]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] ARM: highbank: Fix refcount leak in highbank_init
Date
of_find_compatible_node() returns a node pointer with refcount
incremented, we should use of_node_put() on it when done.
Add missing of_node_put() to avoid refcount leak.

Fixes: 220e6cf7b793 ("ARM: add Highbank core platform support")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
---
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..af9488854fe3 100644
--- a/arch/arm/mach-highbank/highbank.c
+++ b/arch/arm/mach-highbank/highbank.c
@@ -142,6 +142,7 @@ static void __init highbank_init(void)
np = of_find_compatible_node(NULL, NULL, "calxeda,hb-sregs");
sregs_base = of_iomap(np, 0);
WARN_ON(!sregs_base);
+ of_node_put(np);

pm_power_off = highbank_power_off;
highbank_pm_init();
--
2.25.1
\
 
 \ /
  Last update: 2022-05-12 05:14    [W:2.587 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site