summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/sysdev
diff options
context:
space:
mode:
authorYueHaibing <yuehaibing@huawei.com>2018-04-25 13:27:07 +0200
committerMichael Ellerman <mpe@ellerman.id.au>2018-06-03 12:43:35 +0200
commit589b1f7e4b0db4c31cef3b55f7514857bfc4b093 (patch)
tree52a7c5e4b693f56bfff0f94112a96c2470a6dc02 /arch/powerpc/sysdev
parentpowerpc: cpm_gpio: Remove owner assignment from platform_driver (diff)
downloadlinux-589b1f7e4b0db4c31cef3b55f7514857bfc4b093.tar.xz
linux-589b1f7e4b0db4c31cef3b55f7514857bfc4b093.zip
powerpc/xics: Add missing of_node_put() in error path
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> [mpe: Invert the sense of the if so we only need one return path] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r--arch/powerpc/sysdev/xics/xics-common.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/powerpc/sysdev/xics/xics-common.c b/arch/powerpc/sysdev/xics/xics-common.c
index 77e864d5506d..f87470319d71 100644
--- a/arch/powerpc/sysdev/xics/xics-common.c
+++ b/arch/powerpc/sysdev/xics/xics-common.c
@@ -446,10 +446,11 @@ static void __init xics_get_server_size(void)
np = of_find_compatible_node(NULL, NULL, "ibm,ppc-xics");
if (!np)
return;
+
isize = of_get_property(np, "ibm,interrupt-server#-size", NULL);
- if (!isize)
- return;
- xics_interrupt_server_size = be32_to_cpu(*isize);
+ if (isize)
+ xics_interrupt_server_size = be32_to_cpu(*isize);
+
of_node_put(np);
}