]> git.hungrycats.org Git - linux/commitdiff
[PATCH] fix oops in fork() cleanup path
authorJohn L. Byrne <john.l.byrne@hp.com>
Wed, 13 Oct 2004 14:26:01 +0000 (07:26 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Wed, 13 Oct 2004 14:26:01 +0000 (07:26 -0700)
It will oops on an error path if the thread being forked is a process with
a NULL mm.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
kernel/fork.c

index 8c7ba481c9a5974b5e47324e00a417068ef2053d..7e73e420441e98f90ccdb69e900d8fd3d491e1dd 100644 (file)
@@ -1146,7 +1146,8 @@ fork_out:
 bad_fork_cleanup_namespace:
        exit_namespace(p);
 bad_fork_cleanup_mm:
-       mmput(p->mm);
+       if (p->mm)
+               mmput(p->mm);
 bad_fork_cleanup_signal:
        exit_signal(p);
 bad_fork_cleanup_sighand: