Commit 511ca0be authored by John L. Byrne's avatar John L. Byrne Committed by Linus Torvalds

[PATCH] fix oops in fork() cleanup path

It will oops on an error path if the thread being forked is a process with
a NULL mm.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 011a660d
......@@ -1146,7 +1146,8 @@ static task_t *copy_process(unsigned long clone_flags,
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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment