Skip to content

Commit

Permalink
powerpc/signal32: Simplify logging in sigreturn()
Browse files Browse the repository at this point in the history
Same spirit as commit debf122 ("powerpc/signal32: Simplify logging
in handle_rt_signal32()"), remove this intermediate 'addr' local var.

Signed-off-by: Christophe Leroy <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/638fa99530beb29f82f94370057d110e91272acc.1616151715.git.christophe.leroy@csgroup.eu
  • Loading branch information
chleroy authored and mpe committed Apr 3, 2021
1 parent 9a64101 commit c465077
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions arch/powerpc/kernel/signal_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,6 @@ SYSCALL_DEFINE0(sigreturn)
struct sigcontext __user *sc;
struct sigcontext sigctx;
struct mcontext __user *sr;
void __user *addr;
sigset_t set;
struct mcontext __user *mcp;
struct mcontext __user *tm_mcp = NULL;
Expand All @@ -1363,7 +1362,6 @@ SYSCALL_DEFINE0(sigreturn)

sf = (struct sigframe __user *)(regs->gpr[1] + __SIGNAL_FRAMESIZE);
sc = &sf->sctx;
addr = sc;
if (copy_from_user(&sigctx, sc, sizeof(sigctx)))
goto badframe;

Expand Down Expand Up @@ -1392,16 +1390,19 @@ SYSCALL_DEFINE0(sigreturn)
goto badframe;
} else {
sr = (struct mcontext __user *)from_user_ptr(sigctx.regs);
addr = sr;
if (restore_user_regs(regs, sr, 1))
goto badframe;
if (restore_user_regs(regs, sr, 1)) {
signal_fault(current, regs, "sys_sigreturn", sr);

force_sig(SIGSEGV);
return 0;
}
}

set_thread_flag(TIF_RESTOREALL);
return 0;

badframe:
signal_fault(current, regs, "sys_sigreturn", addr);
signal_fault(current, regs, "sys_sigreturn", sc);

force_sig(SIGSEGV);
return 0;
Expand Down

0 comments on commit c465077

Please sign in to comment.