Skip to content

Commit

Permalink
PM / Hibernate: Enable usermodehelpers in hibernate() error path
Browse files Browse the repository at this point in the history
If create_basic_memory_bitmaps() fails, usermodehelpers are not re-enabled
before returning. Fix this. And while at it, reword the goto labels so that
they look more meaningful.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
  • Loading branch information
Srivatsa S. Bhat authored and Rafael J. Wysocki committed Mar 4, 2012
1 parent 4782e16 commit 05b4877
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions kernel/power/hibernate.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,15 +618,15 @@ int hibernate(void)
/* Allocate memory management structures */
error = create_basic_memory_bitmaps();
if (error)
goto Exit;
goto Enable_umh;

printk(KERN_INFO "PM: Syncing filesystems ... ");
sys_sync();
printk("done.\n");

error = freeze_processes();
if (error)
goto Finish;
goto Free_bitmaps;

error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
if (error || freezer_test_done)
Expand Down Expand Up @@ -659,8 +659,9 @@ int hibernate(void)
/* Don't bother checking whether freezer_test_done is true */
freezer_test_done = false;

Finish:
Free_bitmaps:
free_basic_memory_bitmaps();
Enable_umh:
usermodehelper_enable();
Exit:
pm_notifier_call_chain(PM_POST_HIBERNATION);
Expand Down

0 comments on commit 05b4877

Please sign in to comment.