mirror of https://gitee.com/openkylin/linux.git
PM / Hibernate: Enable usermodehelpers in hibernate() error path
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>
This commit is contained in:
parent
4782e1654b
commit
05b4877f6a
|
@ -618,7 +618,7 @@ int hibernate(void)
|
||||||
/* Allocate memory management structures */
|
/* Allocate memory management structures */
|
||||||
error = create_basic_memory_bitmaps();
|
error = create_basic_memory_bitmaps();
|
||||||
if (error)
|
if (error)
|
||||||
goto Exit;
|
goto Enable_umh;
|
||||||
|
|
||||||
printk(KERN_INFO "PM: Syncing filesystems ... ");
|
printk(KERN_INFO "PM: Syncing filesystems ... ");
|
||||||
sys_sync();
|
sys_sync();
|
||||||
|
@ -626,7 +626,7 @@ int hibernate(void)
|
||||||
|
|
||||||
error = freeze_processes();
|
error = freeze_processes();
|
||||||
if (error)
|
if (error)
|
||||||
goto Finish;
|
goto Free_bitmaps;
|
||||||
|
|
||||||
error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
|
error = hibernation_snapshot(hibernation_mode == HIBERNATION_PLATFORM);
|
||||||
if (error || freezer_test_done)
|
if (error || freezer_test_done)
|
||||||
|
@ -659,8 +659,9 @@ int hibernate(void)
|
||||||
/* Don't bother checking whether freezer_test_done is true */
|
/* Don't bother checking whether freezer_test_done is true */
|
||||||
freezer_test_done = false;
|
freezer_test_done = false;
|
||||||
|
|
||||||
Finish:
|
Free_bitmaps:
|
||||||
free_basic_memory_bitmaps();
|
free_basic_memory_bitmaps();
|
||||||
|
Enable_umh:
|
||||||
usermodehelper_enable();
|
usermodehelper_enable();
|
||||||
Exit:
|
Exit:
|
||||||
pm_notifier_call_chain(PM_POST_HIBERNATION);
|
pm_notifier_call_chain(PM_POST_HIBERNATION);
|
||||||
|
|
Loading…
Reference in New Issue