The patch titled rpaphp: correctly call pci_hp_register for empty PCI slots has been added to the -mm tree. Its filename is pci-hotplug-introduce-pci_slot-rpaphp-correctly-call-pci_hp_register-for-empty-pci-slots.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://www.zip.com.au/~akpm/linux/patches/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: rpaphp: correctly call pci_hp_register for empty PCI slots From: Alex Chiang <achiang@xxxxxx> Unpopulated device_node slots do not have children, and attempting to dereference them will result in a panic. Instead, attempt to derive the PCI slot number from the bus itself, and failing that, default to 0. Signed-off-by: Alex Chiang <achiang@xxxxxx> Cc: Matthew Wilcox <matthew@xxxxxx> Cc: Greg KH <greg@xxxxxxxxx> Cc: Kristen Carlson Accardi <kristen.c.accardi@xxxxxxxxx> Cc: Len Brown <lenb@xxxxxxxxxx> Cc: Kenji Kaneshige <kaneshige.kenji@xxxxxxxxxxxxxx> Tested-by: Badari Pulavarty <pbadari@xxxxxxxxxx> Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/pci/hotplug/rpaphp_slot.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff -puN drivers/pci/hotplug/rpaphp_slot.c~pci-hotplug-introduce-pci_slot-rpaphp-correctly-call-pci_hp_register-for-empty-pci-slots drivers/pci/hotplug/rpaphp_slot.c --- a/drivers/pci/hotplug/rpaphp_slot.c~pci-hotplug-introduce-pci_slot-rpaphp-correctly-call-pci_hp_register-for-empty-pci-slots +++ a/drivers/pci/hotplug/rpaphp_slot.c @@ -121,6 +121,7 @@ int rpaphp_register_slot(struct slot *sl { struct hotplug_slot *php_slot = slot->hotplug_slot; int retval; + int slot_nr; dbg("%s registering slot:path[%s] index[%x], name[%s] pdomain[%x] type[%d]\n", __func__, slot->dn->full_name, slot->index, slot->name, @@ -132,8 +133,11 @@ int rpaphp_register_slot(struct slot *sl return -EAGAIN; } - retval = pci_hp_register(php_slot, slot->bus, - PCI_SLOT(PCI_DN(slot->dn->child)->devfn)); + if (slot->bus->self) + slot_nr = PCI_SLOT(slot->bus->self->devfn); + else + slot_nr = 0; + retval = pci_hp_register(php_slot, slot->bus, slot_nr); if (retval) { err("pci_hp_register failed with error %d\n", retval); return retval; _ Patches currently in -mm which might be from achiang@xxxxxx are pci-hotplug-construct-one-fakephp-slot-per-pci-slot.patch pci-hotplug-export-kobject_rename-for-pci_hotplug_core.patch pci-hotplug-introduce-pci_slot.patch pci-hotplug-introduce-pci_slot-rpaphp-correctly-call-pci_hp_register-for-empty-pci-slots.patch pci-hotplug-acpi-pci-slot-detection-driver.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