powerpc/pseries: Fix parent_dn reference leak in add_dt_node()
authorTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Wed, 20 Sep 2017 21:02:52 +0000 (17:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Oct 2017 07:41:45 +0000 (09:41 +0200)
commitfe37a445ea3f0e8bd285c5d09fd223059c3b644e
treebcfc7c4588d48defebf17f134248180f60e51ff6
parent638b38505045e1090313ff7ed284911870cd29f8
powerpc/pseries: Fix parent_dn reference leak in add_dt_node()

commit b537ca6fede69a281dc524983e5e633d79a10a08 upstream.

A reference to the parent device node is held by add_dt_node() for the
node to be added. If the call to dlpar_configure_connector() fails
add_dt_node() returns ENOENT and that reference is not freed.

Add a call to of_node_put(parent_dn) prior to bailing out after a
failed dlpar_configure_connector() call.

Fixes: 8d5ff320766f ("powerpc/pseries: Make dlpar_configure_connector parent node aware")
Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/platforms/pseries/mobility.c