PM / Hibernate: Disable usermode helpers right before freezing tasks

There is no reason to call usermodehelper_disable() before creating
memory bitmaps in hibernate() and software_resume(), so call it right
before freeze_processes(), in accordance with the other suspend and
hibernation code.  Consequently, call usermodehelper_enable() right
after the thawing of tasks rather than after freeing the memory
bitmaps.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: stable@vger.kernel.org
This commit is contained in:
Rafael J. Wysocki 2012-03-28 23:30:14 +02:00
Родитель 9b78c1da60
Коммит 7b5179ac14
1 изменённых файлов: 10 добавлений и 13 удалений

Просмотреть файл

@ -611,19 +611,19 @@ int hibernate(void)
if (error) if (error)
goto Exit; goto Exit;
error = usermodehelper_disable();
if (error)
goto Exit;
/* Allocate memory management structures */ /* Allocate memory management structures */
error = create_basic_memory_bitmaps(); error = create_basic_memory_bitmaps();
if (error) if (error)
goto Enable_umh; goto Exit;
printk(KERN_INFO "PM: Syncing filesystems ... "); printk(KERN_INFO "PM: Syncing filesystems ... ");
sys_sync(); sys_sync();
printk("done.\n"); printk("done.\n");
error = usermodehelper_disable();
if (error)
goto Exit;
error = freeze_processes(); error = freeze_processes();
if (error) if (error)
goto Free_bitmaps; goto Free_bitmaps;
@ -660,9 +660,8 @@ int hibernate(void)
freezer_test_done = false; freezer_test_done = false;
Free_bitmaps: Free_bitmaps:
free_basic_memory_bitmaps();
Enable_umh:
usermodehelper_enable(); usermodehelper_enable();
free_basic_memory_bitmaps();
Exit: Exit:
pm_notifier_call_chain(PM_POST_HIBERNATION); pm_notifier_call_chain(PM_POST_HIBERNATION);
pm_restore_console(); pm_restore_console();
@ -777,15 +776,13 @@ static int software_resume(void)
if (error) if (error)
goto close_finish; goto close_finish;
error = usermodehelper_disable(); error = create_basic_memory_bitmaps();
if (error) if (error)
goto close_finish; goto close_finish;
error = create_basic_memory_bitmaps(); error = usermodehelper_disable();
if (error) { if (error)
usermodehelper_enable();
goto close_finish; goto close_finish;
}
pr_debug("PM: Preparing processes for restore.\n"); pr_debug("PM: Preparing processes for restore.\n");
error = freeze_processes(); error = freeze_processes();
@ -805,8 +802,8 @@ static int software_resume(void)
swsusp_free(); swsusp_free();
thaw_processes(); thaw_processes();
Done: Done:
free_basic_memory_bitmaps();
usermodehelper_enable(); usermodehelper_enable();
free_basic_memory_bitmaps();
Finish: Finish:
pm_notifier_call_chain(PM_POST_RESTORE); pm_notifier_call_chain(PM_POST_RESTORE);
pm_restore_console(); pm_restore_console();