Skip to contentSkip to conversation

ia64: fix syscall_get_error()

PATCH New Dmitry V. Levin 1 participant 2 messages Dec 3, 2018 – Jan 11, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ia64: fix syscall_get_error()

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 [email protected] # v2.6.27+
---
 arch/ia64/include/asm/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/include/asm/syscall.h +1 -1
index 1d0b875fec44..4ccf888c083d 100644
@@ -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,
Signature · 1 line
ldv
#1 lore raw

PATCH 1/1 ia64: fix syscall_get_error()

PING

Quoted 29 lines · Dmitry V. Levin

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 [email protected] # v2.6.27+
---
 arch/ia64/include/asm/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/ia64/include/asm/syscall.h +1 -1
index 1d0b875fec44..4ccf888c083d 100644
@@ -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,
Signature · 1 line
ldv
Signature · 1 line
ldv