aboutsummaryrefslogtreecommitdiff
path: root/drivers/pci/remove.c
diff options
context:
space:
mode:
authorYu Zhao <yu.zhao@intel.com>2009-01-28 18:27:21 +0800
committerJesse Barnes <jbarnes@hobbes.lan>2009-03-19 19:29:26 -0700
commit2b56313448bb8efad3af19f211d988c8352ac04d (patch)
tree6142ea40139dc49348111b688c349e133a1fe667 /drivers/pci/remove.c
parent11df1f05514beaf0269484191007dbc8d47e0e6f (diff)
PCI: check if a bus is added when removing it
When removing a bus, 'is_added' should be checked to make sure the bus has been successfully added by pci_bus_add_child() who will sets 'is_added'. Signed-off-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/remove.c')
-rw-r--r--drivers/pci/remove.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c
index 042e0892442..caf8e1eae45 100644
--- a/drivers/pci/remove.c
+++ b/drivers/pci/remove.c
@@ -71,6 +71,9 @@ void pci_remove_bus(struct pci_bus *pci_bus)
down_write(&pci_bus_sem);
list_del(&pci_bus->node);
up_write(&pci_bus_sem);
+ if (!pci_bus->is_added)
+ return;
+
pci_remove_legacy_files(pci_bus);
device_remove_file(&pci_bus->dev, &dev_attr_cpuaffinity);
device_remove_file(&pci_bus->dev, &dev_attr_cpulistaffinity);