From: Al Viro Date: Mon, 22 Oct 2012 02:33:39 +0000 (-0400) Subject: powerpc: make fork_idle() take the common "kernel thread" path in copy_thread() X-Git-Tag: next-20121023~9^2^3 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ab75819d3942a34d151a34fd43f346d5d8a48148;p=karo-tx-linux.git powerpc: make fork_idle() take the common "kernel thread" path in copy_thread() Signed-off-by: Al Viro --- diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c index 3665d287780f..f6d244db9203 100644 --- a/arch/powerpc/kernel/process.c +++ b/arch/powerpc/kernel/process.c @@ -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);