aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorYu Zhao <yu.zhao@intel.com>2009-01-28 05:27:21 -0500
committerJesse Barnes <jbarnes@hobbes.lan>2009-03-19 22:29:26 -0400
commit2b56313448bb8efad3af19f211d988c8352ac04d (patch)
tree6142ea40139dc49348111b688c349e133a1fe667 /drivers/pci
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')
-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)
71 down_write(&pci_bus_sem); 71 down_write(&pci_bus_sem);
72 list_del(&pci_bus->node); 72 list_del(&pci_bus->node);
73 up_write(&pci_bus_sem); 73 up_write(&pci_bus_sem);
74 if (!pci_bus->is_added)
75 return;
76
74 pci_remove_legacy_files(pci_bus); 77 pci_remove_legacy_files(pci_bus);
75 device_remove_file(&pci_bus->dev, &dev_attr_cpuaffinity); 78 device_remove_file(&pci_bus->dev, &dev_attr_cpuaffinity);
76 device_remove_file(&pci_bus->dev, &dev_attr_cpulistaffinity); 79 device_remove_file(&pci_bus->dev, &dev_attr_cpulistaffinity);