powerpc/kernel: Fix unbalanced refcount on RTAS device node
authorGavin Shan <gwshan@linux.vnet.ibm.com>
Mon, 23 Jan 2017 22:49:54 +0000 (09:49 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 25 Jan 2017 02:34:21 +0000 (13:34 +1100)
commit8b2577832100706124fd6fe09f887992c8d7c0c6
treef282323294d1414167aa69da4a606a75c49eb453
parentde6d2d1b7bf2b3a8d5e57ebffad9f2688fe00a7a
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>
arch/powerpc/kernel/rtas.c