summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2022-08-08 16:08:48 +0100
committerDinh Nguyen <dinguyen@kernel.org>2022-08-15 11:25:32 -0500
commit2d631bd58fe0ea3e3350212e23c9aba1fb606514 (patch)
treeb94a9773d4de37cce561d676e678d60a97866f41 /arch
parent25ba820ef36bdbaf9884adeac69b6e1821a7df76 (diff)
downloadlinux-stable-2d631bd58fe0ea3e3350212e23c9aba1fb606514.tar.gz
linux-stable-2d631bd58fe0ea3e3350212e23c9aba1fb606514.tar.bz2
linux-stable-2d631bd58fe0ea3e3350212e23c9aba1fb606514.zip
nios2: fix syscall restart checks
sys_foo() returns -512 (aka -ERESTARTSYS) => do_signal() sees 512 in r2 and 1 in r1. sys_foo() returns 512 => do_signal() sees 512 in r2 and 0 in r1. The former is restart-worthy; the latter obviously isn't. Fixes: b53e906d255d ("nios2: Signal handling support") Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/nios2/kernel/signal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/nios2/kernel/signal.c b/arch/nios2/kernel/signal.c
index cb0b91589cf2..15e672d7150e 100644
--- a/arch/nios2/kernel/signal.c
+++ b/arch/nios2/kernel/signal.c
@@ -242,7 +242,7 @@ static int do_signal(struct pt_regs *regs)
/*
* If we were from a system call, check for system call restarting...
*/
- if (regs->orig_r2 >= 0) {
+ if (regs->orig_r2 >= 0 && regs->r1) {
continue_addr = regs->ea;
restart_addr = continue_addr - 4;
retval = regs->r2;