aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/rtas.c
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2017-01-24 09:49:54 +1100
committerMichael Ellerman <mpe@ellerman.id.au>2017-01-25 13:34:21 +1100
commit8b2577832100706124fd6fe09f887992c8d7c0c6 (patch)
treef282323294d1414167aa69da4a606a75c49eb453 /arch/powerpc/kernel/rtas.c
parentde6d2d1b7bf2b3a8d5e57ebffad9f2688fe00a7a (diff)
powerpc/kernel: Fix unbalanced refcount on RTAS device node
The RTAS device-tree node's refcount has been increased by one in the function call of_find_node_by_name(), but it's missed to be decreased by one in the error path. It leads to unbalanced refcount on RTAS device-tree node. This fixes above issue by decreasing RTAS device-tree node's refcount in error path. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/rtas.c')
-rw-r--r--arch/powerpc/kernel/rtas.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
index ba5a4cc0e5b6..b8a4987f58cf 100644
--- a/arch/powerpc/kernel/rtas.c
+++ b/arch/powerpc/kernel/rtas.c
@@ -1158,6 +1158,7 @@ void __init rtas_initialize(void)
no_base = of_property_read_u32(rtas.dev, "linux,rtas-base", &base);
no_size = of_property_read_u32(rtas.dev, "rtas-size", &size);
if (no_base || no_size) {
+ of_node_put(rtas.dev);
rtas.dev = NULL;
return;
}