]> git.ipfire.org Git - people/arne_f/kernel.git/commit
PCI: rpadlpar: Fix leaked device_node references in add/remove paths
authorTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Fri, 22 Mar 2019 18:27:21 +0000 (13:27 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 15 Jun 2019 09:54:09 +0000 (11:54 +0200)
commit671fc9007c480ed6e8edbb2126df29dcbb08f3b3
treeb74b2e4cd3eb6120c81ac4881916a887525e94e1
parentb531acbd86d2ddb666da973b0441a685f9959115
PCI: rpadlpar: Fix leaked device_node references in add/remove paths

[ Upstream commit fb26228bfc4ce3951544848555c0278e2832e618 ]

The find_dlpar_node() helper returns a device node with its reference
incremented.  Both the add and remove paths use this helper for find the
appropriate node, but fail to release the reference when done.

Annotate the find_dlpar_node() helper with a comment about the incremented
reference count and call of_node_put() on the obtained device_node in the
add and remove paths.  Also, fixup a reference leak in the find_vio_slot()
helper where we fail to call of_node_put() on the vdevice node after we
iterate over its children.

Signed-off-by: Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/hotplug/rpadlpar_core.c