summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPatrick Mochel <mochel@osdl.org>2002-10-16 23:51:44 -0700
committerPatrick Mochel <mochel@osdl.org>2002-10-16 23:51:44 -0700
commitcdca2b1ca897470af06970ee5ad0f9270d5cb16d (patch)
treebe28f7b11f16a20cbfdf6742582ad4c67de3ddd3 /drivers
parent7b97a9fd22a391fdc5891f1ef48dbd7f0245d0dc (diff)
driver model: use list_for_each_safe() when removing devices from a driver.
Duh: in driver_detach(), one of the first things we do is remove the device from the driver's list of devices. So, we obviously cannot use ->next.
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);