]> www.infradead.org Git - linux.git/commit
pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv
authorKrishna Kumar <krishnak@linux.ibm.com>
Mon, 1 Jul 2024 07:45:06 +0000 (13:15 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 4 Jul 2024 13:10:40 +0000 (23:10 +1000)
commit335e35b748527f0c06ded9eebb65387f60647fda
treeb35e83a88993d6aabd87afb055bb823632eb164a
parent45547a0a93d85f704b49788cde2e1d9ab9cd363b
pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv

The hotplug driver for powerpc (pci/hotplug/pnv_php.c) causes a kernel
crash when we try to hot-unplug/disable the PCIe switch/bridge from
the PHB.

The crash occurs because although the MSI data structure has been
released during disable/hot-unplug path and it has been assigned
with NULL, still during unregistration the code was again trying to
explicitly disable the MSI which causes the NULL pointer dereference and
kernel crash.

The patch fixes the check during unregistration path to prevent invoking
pci_disable_msi/msix() since its data structure is already freed.

Reported-by: Timothy Pearson <tpearson@raptorengineering.com>
Closes: https://lore.kernel.org/all/1981605666.2142272.1703742465927.JavaMail.zimbra@raptorengineeringinc.com/
Acked-by: Bjorn Helgaas <bhelgaas@google.com>
Tested-by: Shawn Anastasio <sanastasio@raptorengineering.com>
Signed-off-by: Krishna Kumar <krishnak@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240701074513.94873-2-krishnak@linux.ibm.com
drivers/pci/hotplug/pnv_php.c