Skip to content

Commit

Permalink
sh: bring syscall_set_return_value in line with other architectures
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Michael Karcher authored and Rich Felker committed Aug 15, 2020
1 parent 0bb605c commit 03dd061
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/sh/include/asm/syscall_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ static inline void syscall_set_return_value(struct task_struct *task,
struct pt_regs *regs,
int error, long val)
{
if (error)
regs->regs[0] = -error;
else
regs->regs[0] = val;
regs->regs[0] = (long) error ?: val;
}

static inline void syscall_get_arguments(struct task_struct *task,
Expand Down

0 comments on commit 03dd061

Please sign in to comment.