]> git.baikalelectronics.ru Git - kernel.git/commit
PCIe: AER: during disable, check subordinate before walking
authorAlex Chiang <achiang@hp.com>
Fri, 6 Mar 2009 02:28:40 +0000 (19:28 -0700)
committerMatthew Wilcox <willy@linux.intel.com>
Thu, 12 Mar 2009 19:09:51 +0000 (15:09 -0400)
commit32ee502d652b62549ac83a222fb066be3178e0ae
treef6cacbf06c400498c05bb4072f61e045aac0204e
parent53a09a887fd4dcd8299a9deb1cba0e2699284979
PCIe: AER: during disable, check subordinate before walking

Commit 47a8b0cc (Enable PCIe AER only after checking firmware
support) wants to walk the PCI bus in the remove path to disable
AER, and calls pci_walk_bus for downstream bridges.

Unfortunately, in the remove path, we remove devices and bridges
in a depth-first manner, starting with the furthest downstream
bridge and working our way backwards.

The furthest downstream bridges will not have a dev->subordinate,
and we hit a NULL deref in pci_walk_bus.

Check for dev->subordinate first before attempting to walk the
PCI hierarchy below us.

Acked-by: Andrew Patterson <andrew.patterson@hp.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
drivers/pci/pcie/aer/aerdrv_core.c