summaryrefslogtreecommitdiff
path: root/arch/riscv/kernel/compat_signal.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/riscv/kernel/compat_signal.c')
-rw-r--r--arch/riscv/kernel/compat_signal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/riscv/kernel/compat_signal.c b/arch/riscv/kernel/compat_signal.c
index 6ec4e34255a9..cf3eb33a11e4 100644
--- a/arch/riscv/kernel/compat_signal.c
+++ b/arch/riscv/kernel/compat_signal.c
@@ -107,6 +107,8 @@ static long compat_restore_sigcontext(struct pt_regs *regs,
/* sc_regs is structured the same as the start of pt_regs */
err = __copy_from_user(&cregs, &sc->sc_regs, sizeof(sc->sc_regs));
+ if (unlikely(err))
+ return err;
cregs_to_regs(&cregs, regs);