aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/bus.c')
-rw-r--r--drivers/base/bus.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index d516f7d5f168..d7c5ea246a0b 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -439,8 +439,10 @@ void bus_remove_device(struct device * dev)
439 sysfs_remove_link(&dev->kobj, "bus"); 439 sysfs_remove_link(&dev->kobj, "bus");
440 sysfs_remove_link(&dev->bus->devices.kobj, dev->bus_id); 440 sysfs_remove_link(&dev->bus->devices.kobj, dev->bus_id);
441 device_remove_attrs(dev->bus, dev); 441 device_remove_attrs(dev->bus, dev);
442 dev->is_registered = 0; 442 if (dev->is_registered) {
443 klist_del(&dev->knode_bus); 443 dev->is_registered = 0;
444 klist_del(&dev->knode_bus);
445 }
444 pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id); 446 pr_debug("bus %s: remove device %s\n", dev->bus->name, dev->bus_id);
445 device_release_driver(dev); 447 device_release_driver(dev);
446 put_bus(dev->bus); 448 put_bus(dev->bus);