diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-19 01:58:59 +0400 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-04-19 01:58:59 +0400 |
commit | 2ca6f62f595c01f689b269db6736de5544da7667 (patch) | |
tree | bfc4b2225ea1df64542c92dd8336420515072faa /kernel/power/suspend.c | |
parent | a1b49cb7e2a7961ec3aa8b64860bf480d4ec9077 (diff) | |
download | linux-2ca6f62f595c01f689b269db6736de5544da7667.tar.xz |
PM: Fix error code paths executed after failing syscore_suspend()
If syscore_suspend() fails in suspend_enter(), create_image() or
resume_target_kernel(), it is necessary to call sysdev_resume(),
because sysdev_suspend() has been called already and succeeded
and we are going to abort the transition.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel/power/suspend.c')
-rw-r--r-- | kernel/power/suspend.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 2814c32aed51..8935369d503a 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -164,8 +164,11 @@ static int suspend_enter(suspend_state_t state) BUG_ON(!irqs_disabled()); error = sysdev_suspend(PMSG_SUSPEND); - if (!error) + if (!error) { error = syscore_suspend(); + if (error) + sysdev_resume(); + } if (!error) { if (!(suspend_test(TEST_CORE) || pm_wakeup_pending())) { error = suspend_ops->enter(state); |