diff options
Diffstat (limited to 'drivers/pci/remove.c')
-rw-r--r-- | drivers/pci/remove.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/pci/remove.c b/drivers/pci/remove.c index 9684e1bde27..d3c77cbe327 100644 --- a/drivers/pci/remove.c +++ b/drivers/pci/remove.c @@ -18,13 +18,11 @@ static void pci_free_resources(struct pci_dev *dev) static void pci_stop_dev(struct pci_dev *dev) { - if (!dev->global_list.next) - return; - - if (!list_empty(&dev->global_list)) { + if (dev->is_added) { pci_proc_detach_device(dev); pci_remove_sysfs_dev_files(dev); device_unregister(&dev->dev); + dev->is_added = 0; down_write(&pci_bus_sem); list_del(&dev->global_list); dev->global_list.next = dev->global_list.prev = NULL; |