diff options
Diffstat (limited to 'arch/openrisc/kernel/process.c')
-rw-r--r-- | arch/openrisc/kernel/process.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/openrisc/kernel/process.c b/arch/openrisc/kernel/process.c index e0874b8..6b85366 100644 --- a/arch/openrisc/kernel/process.c +++ b/arch/openrisc/kernel/process.c @@ -168,9 +168,10 @@ copy_thread(unsigned long clone_flags, unsigned long usp, kregs->gpr[20] = usp; /* fn, kernel thread */ kregs->gpr[22] = arg; } else { - *userregs = *regs; + *userregs = *current_pt_regs(); - userregs->sp = usp; + if (usp) + userregs->sp = usp; userregs->gpr[11] = 0; /* Result from fork() */ kregs->gpr[20] = 0; /* Userspace thread */ |