diff options
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/power/shutdown.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/base/power/shutdown.c b/drivers/base/power/shutdown.c index a47bb74da72b..c2475f3134ea 100644 --- a/drivers/base/power/shutdown.c +++ b/drivers/base/power/shutdown.c | |||
@@ -35,10 +35,10 @@ extern int sysdev_shutdown(void); | |||
35 | */ | 35 | */ |
36 | void device_shutdown(void) | 36 | void device_shutdown(void) |
37 | { | 37 | { |
38 | struct device * dev; | 38 | struct device * dev, *devn; |
39 | 39 | ||
40 | down_write(&devices_subsys.rwsem); | 40 | down_write(&devices_subsys.rwsem); |
41 | list_for_each_entry_reverse(dev, &devices_subsys.kset.list, | 41 | list_for_each_entry_safe_reverse(dev, devn, &devices_subsys.kset.list, |
42 | kobj.entry) { | 42 | kobj.entry) { |
43 | if (dev->bus && dev->bus->shutdown) { | 43 | if (dev->bus && dev->bus->shutdown) { |
44 | dev_dbg(dev, "shutdown\n"); | 44 | dev_dbg(dev, "shutdown\n"); |