Skip to content

Commit

Permalink
[PATCH] uml: always disable kmalloc during shutdown
Browse files Browse the repository at this point in the history
kmalloc wasn't being disabled during panic.  This patch ensures that, no
matter how UML is exiting, it is disabled.  This matters because part of the
cleanup is to remove the umid file, which involves readdir, which calls
malloc.  This must map to libc malloc, rather than kmalloc or vmalloc.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Jeff Dike authored and Linus Torvalds committed Jun 25, 2005
1 parent a6f4e3c commit 026549d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
1 change: 0 additions & 1 deletion arch/um/kernel/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ static __init void do_uml_initcalls(void)

static void last_ditch_exit(int sig)
{
kmalloc_ok = 0;
signal(SIGINT, SIG_DFL);
signal(SIGTERM, SIG_DFL);
signal(SIGHUP, SIG_DFL);
Expand Down
9 changes: 4 additions & 5 deletions arch/um/kernel/reboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,22 @@ static void kill_off_processes(void)

void uml_cleanup(void)
{
kill_off_processes();
kmalloc_ok = 0;
do_uml_exitcalls();
kill_off_processes();
}

void machine_restart(char * __unused)
{
do_uml_exitcalls();
kill_off_processes();
uml_cleanup();
CHOOSE_MODE(reboot_tt(), reboot_skas());
}

EXPORT_SYMBOL(machine_restart);

void machine_power_off(void)
{
do_uml_exitcalls();
kill_off_processes();
uml_cleanup();
CHOOSE_MODE(halt_tt(), halt_skas());
}

Expand Down

0 comments on commit 026549d

Please sign in to comment.