Message ID | 1346622861-30865-3-git-send-email-yinghai@kernel.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index aaae16e..b9f553b 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c @@ -48,11 +48,10 @@ void pci_remove_bus(struct pci_bus *bus) list_del(&bus->node); pci_bus_release_busn_res(bus); up_write(&pci_bus_sem); - if (!bus->is_added) - return; - - pci_remove_legacy_files(bus); - device_unregister(&bus->dev); + if (bus->is_added || pci_is_root_bus(bus)) { + pci_remove_legacy_files(bus); + device_unregister(&bus->dev); + } } EXPORT_SYMBOL(pci_remove_bus);