diff options
-rw-r--r-- | drivers/base/power/main.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 9717d5f20139..508a8f67c028 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c @@ -1251,14 +1251,15 @@ int dpm_suspend_late(pm_message_t state) error = device_suspend_late(dev); mutex_lock(&dpm_list_mtx); + if (!list_empty(&dev->power.entry)) + list_move(&dev->power.entry, &dpm_late_early_list); + if (error) { pm_dev_err(dev, state, " late", error); dpm_save_failed_dev(dev_name(dev)); put_device(dev); break; } - if (!list_empty(&dev->power.entry)) - list_move(&dev->power.entry, &dpm_late_early_list); put_device(dev); if (async_error) |