OSDN Git Service

alpha: fix handling of a3 on straced syscalls
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 18 Sep 2021 22:27:12 +0000 (18:27 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 30 Oct 2022 03:31:15 +0000 (23:31 -0400)
For successful syscall that happens to return a negative, we want
a3 set to 0, no matter whether it's straced or not.  As it is,
for straced case we leave the value it used to have on syscall
entry.  Easily fixed, fortunately...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
arch/alpha/kernel/entry.S

index c41a5a9..78fe7ee 100644 (file)
@@ -600,8 +600,8 @@ ret_from_straced:
 
        /* check return.. */
        blt     $0, $strace_error       /* the call failed */
-       stq     $31, 72($sp)            /* a3=0 => no error */
 $strace_success:
+       stq     $31, 72($sp)            /* a3=0 => no error */
        stq     $0, 0($sp)              /* save return value */
 
        DO_SWITCH_STACK