]> git.proxmox.com Git - mirror_ubuntu-bionic-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)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Wed, 14 Aug 2019 09:18:49 +0000 (11:18 +0200)
commit606653771a6ba992b874fb6f42f6e0a3df660ecc
tree8d7987f070824a949c679f0ae139eff928f465e1
parent886c244a0af2509c96a1ffd521c7c9e239ee9174
PCI: rpadlpar: Fix leaked device_node references in add/remove paths

BugLink: https://bugs.launchpad.net/bugs/1838824
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/pci/hotplug/rpadlpar_core.c