PM / Hibernate: Enable usermodehelpers in hibernate() error path
authorSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Fri, 17 Feb 2012 22:39:51 +0000 (23:39 +0100)
committerRafael J. Wysocki <rjw@sisk.pl>
Sun, 4 Mar 2012 22:08:37 +0000 (23:08 +0100)
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>
kernel/power/hibernate.c

index 72baaf011fb7ed3b9ccd54e48536debc857541e0..0a186cfde7884e6b4f0f3d09e1b3d549e29dafb8 100644 (file)
@@ -618,7 +618,7 @@ 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();
@@ -626,7 +626,7 @@ int hibernate(void)
 
        error = freeze_processes();
        if (error)
-               goto Finish;
+               goto Free_bitmaps;
 
        error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
        if (error || freezer_test_done)
@@ -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);
This page took 0.027159 seconds and 5 git commands to generate.