The patch titled PCIe: AER: during disable, check subordinate before walking has been added to the -mm tree. Its filename is pcie-aer-during-disable-check-subordinate-before-walking.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: PCIe: AER: during disable, check subordinate before walking From: Alex Chiang <achiang@xxxxxx> 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@xxxxxx> Signed-off-by: Alex Chiang <achiang@xxxxxx> Cc: Matthew Wilcox <matthew@xxxxxx> Cc: "Rafael J. Wysocki" <rjw@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/pci/pcie/aer/aerdrv_core.c | 3 +++ 1 file changed, 3 insertions(+) diff -puN drivers/pci/pcie/aer/aerdrv_core.c~pcie-aer-during-disable-check-subordinate-before-walking drivers/pci/pcie/aer/aerdrv_core.c --- a/drivers/pci/pcie/aer/aerdrv_core.c~pcie-aer-during-disable-check-subordinate-before-walking +++ a/drivers/pci/pcie/aer/aerdrv_core.c @@ -133,6 +133,9 @@ static void set_downstream_devices_error bool enable) { set_device_error_reporting(dev, &enable); + + if (!dev->subordinate) + return; pci_walk_bus(dev->subordinate, set_device_error_reporting, &enable); } _ Patches currently in -mm which might be from achiang@xxxxxx are linux-next.patch pcie-aer-during-disable-check-subordinate-before-walking.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html