summaryrefslogtreecommitdiffstats
path: root/arch/h8300
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-04-21 22:42:11 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-21 23:58:07 -0400
commit8b6c3309c94b7296614d7783eb259555a6be6f7e (patch)
tree7568a3f395440a7dbf681b5f2261d286d1a9f97c /arch/h8300
parent9ef461adf9875a0fcaafe4d152a7557740fa1a25 (diff)
downloadlinux-8b6c3309c94b7296614d7783eb259555a6be6f7e.tar.bz2
h8300: don't change blocked signals' mask if setting frame up fails
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/h8300')
-rw-r--r--arch/h8300/kernel/signal.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/arch/h8300/kernel/signal.c b/arch/h8300/kernel/signal.c
index cd63f5a6c8fe..78e9b65df93e 100644
--- a/arch/h8300/kernel/signal.c
+++ b/arch/h8300/kernel/signal.c
@@ -304,7 +304,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size)
return (void *)((usp - frame_size) & -8UL);
}
-static void setup_frame (int sig, struct k_sigaction *ka,
+static int setup_frame (int sig, struct k_sigaction *ka,
sigset_t *set, struct pt_regs *regs)
{
struct sigframe *frame;
@@ -365,13 +365,14 @@ static void setup_frame (int sig, struct k_sigaction *ka,
regs->er1 = (unsigned long)&(frame->sc);
regs->er5 = current->mm->start_data; /* GOT base */
- return;
+ return 0;
give_sigsegv:
force_sigsegv(sig, current);
+ return -EFAULT;
}
-static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
+static int setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
sigset_t *set, struct pt_regs *regs)
{
struct rt_sigframe *frame;
@@ -440,10 +441,11 @@ static void setup_rt_frame (int sig, struct k_sigaction *ka, siginfo_t *info,
regs->er2 = (unsigned long)&frame->uc;
regs->er5 = current->mm->start_data; /* GOT base */
- return;
+ return 0;
give_sigsegv:
force_sigsegv(sig, current);
+ return -EFAULT;
}
/*
@@ -453,6 +455,7 @@ static void
handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
sigset_t *oldset, struct pt_regs * regs)
{
+ int ret;
/* are we from a system call? */
if (regs->orig_er0 >= 0) {
switch (regs->er0) {
@@ -475,11 +478,12 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
/* set up the stack frame */
if (ka->sa.sa_flags & SA_SIGINFO)
- setup_rt_frame(sig, ka, info, oldset, regs);
+ ret = setup_rt_frame(sig, ka, info, oldset, regs);
else
- setup_frame(sig, ka, oldset, regs);
+ ret = setup_frame(sig, ka, oldset, regs);
- block_sigmask(ka, sig);
+ if (!ret)
+ block_sigmask(ka, sig);
}
/*