Skip to content

Commit 03dd061

Browse files
Michael KarcherRich Felker
authored andcommitted
sh: bring syscall_set_return_value in line with other architectures
Other architectures expect that syscall_set_return_value gets an already negative value as error. That's also what kernel/seccomp.c provides. Signed-off-by: Michael Karcher <[email protected]> Tested-by: John Paul Adrian Glaubitz <[email protected]> Signed-off-by: Rich Felker <[email protected]>
1 parent 0bb605c commit 03dd061

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

arch/sh/include/asm/syscall_32.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@ static inline void syscall_set_return_value(struct task_struct *task,
4040
struct pt_regs *regs,
4141
int error, long val)
4242
{
43-
if (error)
44-
regs->regs[0] = -error;
45-
else
46-
regs->regs[0] = val;
43+
regs->regs[0] = (long) error ?: val;
4744
}
4845

4946
static inline void syscall_get_arguments(struct task_struct *task,

0 commit comments

Comments
 (0)