public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ia64: fix syscall_get_error()
@ 2018-12-03  3:17 Dmitry V. Levin
  2020-01-11 16:37 ` [PING PATCH] " Dmitry V. Levin
  0 siblings, 1 reply; 2+ messages in thread
From: Dmitry V. Levin @ 2018-12-03  3:17 UTC (permalink / raw)
  To: Tony Luck, Fenghua Yu
  Cc: Elvira Khabirova, Eugene Syromyatnikov, linux-ia64, linux-kernel

According to documentation in include/asm-generic/syscall.h,
syscall_get_error() should return -ERRORCODE if the system call failed.

This change fixes syscall_get_error() implementation on ia64 to match
its own syscall_set_return_value(), the documentation, and other
architectures where syscall_get_error() returns a non-positive value.

Fixes: cfb361f13c81 ("[IA64] utrace syscall.h support for ia64")
Cc: stable@vger.kernel.org # v2.6.27+
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 arch/ia64/include/asm/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/include/asm/syscall.h b/arch/ia64/include/asm/syscall.h
index 1d0b875fec44..4ccf888c083d 100644
--- a/arch/ia64/include/asm/syscall.h
+++ b/arch/ia64/include/asm/syscall.h
@@ -35,7 +35,7 @@ static inline void syscall_rollback(struct task_struct *task,
 static inline long syscall_get_error(struct task_struct *task,
 				     struct pt_regs *regs)
 {
-	return regs->r10 = -1 ? regs->r8:0;
+	return regs->r10 = -1 ? -regs->r8 : 0;
 }
 
 static inline long syscall_get_return_value(struct task_struct *task,
-- 
ldv

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-11 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-03  3:17 [PATCH] ia64: fix syscall_get_error() Dmitry V. Levin
2020-01-11 16:37 ` [PING PATCH] " Dmitry V. Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox