mips: take the "zero newsp means inherit the parent's one" to copy_thread()
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 27 Dec 2012 16:52:32 +0000 (11:52 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 3 Feb 2013 23:33:01 +0000 (18:33 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/mips/kernel/linux32.c
arch/mips/kernel/process.c
arch/mips/kernel/syscall.c

index 498a7ec656d8e223155437d84680a1dd557f7dad..9df3e330c37c3eed89ba92195417ad13b6388146 100644 (file)
@@ -289,8 +289,6 @@ _sys32_clone(nabi_no_regargs struct pt_regs regs)
 
        clone_flags = regs.regs[4];
        newsp = regs.regs[5];
-       if (!newsp)
-               newsp = regs.regs[29];
        parent_tidptr = (int __user *) regs.regs[6];
 
        /* Use __dummy4 instead of getting it off the stack, so that
index a11c6f9fdd5e0f2e05b306936cb98464f88a130d..a33d2ef8f2734f1d461f48148a8be853cde8ee01 100644 (file)
@@ -156,7 +156,8 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
        *childregs = *regs;
        childregs->regs[7] = 0; /* Clear error flag */
        childregs->regs[2] = 0; /* Child gets zero as return value */
-       childregs->regs[29] = usp;
+       if (usp)
+               childregs->regs[29] = usp;
        ti->addr_limit = USER_DS;
 
        p->thread.reg29 = (unsigned long) childregs;
index 7e1c70dab76706c33cff8f9d8195a02757cac2c2..28daa66baa7bd7d4f889cf8087aa7ebacc5f2aae 100644 (file)
@@ -86,7 +86,7 @@ save_static_function(sys_fork);
 static int __used noinline
 _sys_fork(nabi_no_regargs struct pt_regs regs)
 {
-       return do_fork(SIGCHLD, regs.regs[29], 0, NULL, NULL);
+       return do_fork(SIGCHLD, 0, 0, NULL, NULL);
 }
 
 save_static_function(sys_clone);
@@ -99,8 +99,6 @@ _sys_clone(nabi_no_regargs struct pt_regs regs)
 
        clone_flags = regs.regs[4];
        newsp = regs.regs[5];
-       if (!newsp)
-               newsp = regs.regs[29];
        parent_tidptr = (int __user *) regs.regs[6];
 #ifdef CONFIG_32BIT
        /* We need to fetch the fifth argument off the stack.  */