diff --git a/kernel/power/process.c b/kernel/power/process.c index 879c15a16d34..c52bdd41b5b3 100755 --- a/kernel/power/process.c +++ b/kernel/power/process.c @@ -65,14 +65,14 @@ static int try_to_freeze_tasks(bool user_only) todo += wq_busy; } - if (!todo || time_after(jiffies, end_time)) - break; - if (pm_wakeup_pending()) { wakeup = true; break; } + if (!todo || time_after(jiffies, end_time)) + break; + /* * We need to retry, but first give the freezing tasks some * time to enter the refrigerator. Start with an initial @@ -113,7 +113,7 @@ static int try_to_freeze_tasks(bool user_only) elapsed_msecs % 1000); } - return todo ? -EBUSY : 0; + return todo || wakeup ? -EBUSY : 0; } /**