]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
powerpc/pseries: extract host bridge from pci_bus prior to bus removal
authorTyrel Datwyler <tyreld@linux.ibm.com>
Thu, 11 Feb 2021 18:24:35 +0000 (12:24 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 08:50:12 +0000 (10:50 +0200)
commit697afc664a3508b6d3ac158dc20550a07335e392
tree7d6a6861b7a664a6311d4f37c3b51d33e7b852fc
parent2d101a4c0e3638453befcd142432c77862bdb114
powerpc/pseries: extract host bridge from pci_bus prior to bus removal

[ Upstream commit 38d0b1c9cec71e6d0f3bddef0bbce41d05a3e796 ]

The pci_bus->bridge reference may no longer be valid after
pci_bus_remove() resulting in passing a bad value to device_unregister()
for the associated bridge device.

Store the host_bridge reference in a separate variable prior to
pci_bus_remove().

Fixes: 7340056567e3 ("powerpc/pci: Reorder pci bus/bridge unregistration during PHB removal")
Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20210211182435.47968-1-tyreld@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/pseries/pci_dlpar.c