summaryrefslogtreecommitdiff
path: root/drivers/pci/remove.c
diff options
context:
space:
mode:
authorYu Zhao <yu.zhao@intel.com>2009-01-28 13:27:21 +0300
committerJesse Barnes <jbarnes@hobbes.lan>2009-03-20 05:29:26 +0300
commit2b56313448bb8efad3af19f211d988c8352ac04d (patch)
tree6142ea40139dc49348111b688c349e133a1fe667 /drivers/pci/remove.c
parent11df1f05514beaf0269484191007dbc8d47e0e6f (diff)
downloadlinux-2b56313448bb8efad3af19f211d988c8352ac04d.tar.xz
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 042e08924421..caf8e1eae45e 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);