lkml.org 
[lkml]   [2018]   [Apr]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] powerpc/xics: add missing of_node_put() in error path
Date
The device node obtained with of_find_compatible_node() should be
released by calling of_node_put(). But it was not released when
of_get_property() failed.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
arch/powerpc/sysdev/xics/xics-common.c | 3 +++
1 file changed, 3 insertions(+)

diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c
index 77e864d..e54a9e6 100644
--- a/arch/powerpc/sysdev/xics/xics-common.c
+++ b/arch/powerpc/sysdev/xics/xics-common.c
@@ -448,7 +448,10 @@ static void __init xics_get_server_size(void)
return;
isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
if (!isize)
+ {
+ of_node_put(np);
return;
+ }
xics_interrupt_server_size = be32_to_cpu(*isize);
of_node_put(np);
}
--
2.7.0

\
 
 \ /
  Last update: 2018-04-25 13:28    [W:0.031 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site