[PATCH 5.4 20/80] xtensa: fix syscall_set_return_value

From: Greg Kroah-Hartman
Date: Thu Dec 19 2019 - 13:54:27 EST


From: Max Filippov <jcmvbkbc@xxxxxxxxx>

commit c2d9aa3b6e56de56c7f1ed9026ca6ec7cfbeef19 upstream.

syscall return value is in the register a2, not a0.

Cc: stable@xxxxxxxxxxxxxxx # v5.0+
Fixes: 9f24f3c1067c ("xtensa: implement tracehook functions and enable HAVE_ARCH_TRACEHOOK")
Signed-off-by: Max Filippov <jcmvbkbc@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
arch/xtensa/include/asm/syscall.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/xtensa/include/asm/syscall.h
+++ b/arch/xtensa/include/asm/syscall.h
@@ -51,7 +51,7 @@ static inline void syscall_set_return_va
struct pt_regs *regs,
int error, long val)
{
- regs->areg[0] = (long) error ? error : val;
+ regs->areg[2] = (long) error ? error : val;
}

#define SYSCALL_MAX_ARGS 6