powerpc: make fork_idle() take the common "kernel thread" path in copy_thread()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 22 Oct 2012 02:33:39 +0000 (22:33 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 22 Oct 2012 02:33:39 +0000 (22:33 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/powerpc/kernel/process.c

index 3665d287780fc6d8542907d4d98c77ece0eb6a0b..f6d244db92030ba0e5938675ede2845e33b1f294 100644 (file)
@@ -745,7 +745,7 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
        /* Copy registers */
        sp -= sizeof(struct pt_regs);
        childregs = (struct pt_regs *) sp;
-       if (!regs) {
+       if (unlikely(p->flags & PF_KTHREAD)) {
                struct thread_info *ti = (void *)task_stack_page(p);
                memset(childregs, 0, sizeof(struct pt_regs));
                childregs->gpr[1] = sp + sizeof(struct pt_regs);