summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/bus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 7ef3111f0091..e87a9e825a86 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -174,8 +174,8 @@ static void device_detach(struct device * dev)
static void driver_detach(struct device_driver * drv)
{
- struct list_head * entry;
- list_for_each(entry,&drv->devices) {
+ struct list_head * entry, * next;
+ list_for_each_safe(entry,next,&drv->devices) {
struct device * dev = container_of(entry,struct device,driver_list);
if (get_device(dev)) {
detach(dev,drv);