Skip to content

Commit

Permalink
MIPS: Don't stomp on caller's ->regs[2] in copy_thread()
Browse files Browse the repository at this point in the history
We never needed that (->regs[2] is overwritten on return from syscall paths
with return value of syscall, so storing it there early made no sense) and
with new restart logics since d27240b it
has become really bad - we lose the original syscall number before the
place where we decide that we might need a syscall restart.

Note that for child we do need the assignment to regs[2] - it won't go
through the normal return from syscall path.

[Ralf: Issue found and reported by Lluís; initial investigations by me;
bug finally found and patch by Al; testing by me and Lluís.]

Signed-off-by: Al Viro <[email protected]>
Tested-by: Lluís Batlle i Rossell <[email protected]>
Signed-off-by: Ralf Baechle <[email protected]>
  • Loading branch information
Al Viro authored and ralfbaechle committed Dec 16, 2010
1 parent 2b3e502 commit a989ff8
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion arch/mips/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
childregs->regs[7] = 0; /* Clear error flag */

childregs->regs[2] = 0; /* Child gets zero as return value */
regs->regs[2] = p->pid;

if (childregs->cp0_status & ST0_CU0) {
childregs->regs[28] = (unsigned long) ti;
Expand Down

0 comments on commit a989ff8

Please sign in to comment.