diff options
Diffstat (limited to 'arch/microblaze')
-rw-r--r-- | arch/microblaze/kernel/signal.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/arch/microblaze/kernel/signal.c b/arch/microblaze/kernel/signal.c index 9e749c032af8..f2c13d5a6261 100644 --- a/arch/microblaze/kernel/signal.c +++ b/arch/microblaze/kernel/signal.c | |||
@@ -169,7 +169,7 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, size_t frame_size) | |||
169 | return (void __user *)((sp - frame_size) & -8UL); | 169 | return (void __user *)((sp - frame_size) & -8UL); |
170 | } | 170 | } |
171 | 171 | ||
172 | static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | 172 | static int setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, |
173 | sigset_t *set, struct pt_regs *regs) | 173 | sigset_t *set, struct pt_regs *regs) |
174 | { | 174 | { |
175 | struct rt_sigframe __user *frame; | 175 | struct rt_sigframe __user *frame; |
@@ -267,10 +267,11 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
267 | current->comm, current->pid, frame, regs->pc); | 267 | current->comm, current->pid, frame, regs->pc); |
268 | #endif | 268 | #endif |
269 | 269 | ||
270 | return; | 270 | return 0; |
271 | 271 | ||
272 | give_sigsegv: | 272 | give_sigsegv: |
273 | force_sigsegv(sig, current); | 273 | force_sigsegv(sig, current); |
274 | return -EFAULT; | ||
274 | } | 275 | } |
275 | 276 | ||
276 | /* Handle restarting system calls */ | 277 | /* Handle restarting system calls */ |
@@ -314,21 +315,25 @@ static int | |||
314 | handle_signal(unsigned long sig, struct k_sigaction *ka, | 315 | handle_signal(unsigned long sig, struct k_sigaction *ka, |
315 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) | 316 | siginfo_t *info, sigset_t *oldset, struct pt_regs *regs) |
316 | { | 317 | { |
318 | int ret; | ||
319 | |||
317 | /* Set up the stack frame */ | 320 | /* Set up the stack frame */ |
318 | if (ka->sa.sa_flags & SA_SIGINFO) | 321 | if (ka->sa.sa_flags & SA_SIGINFO) |
319 | setup_rt_frame(sig, ka, info, oldset, regs); | 322 | ret = setup_rt_frame(sig, ka, info, oldset, regs); |
320 | else | 323 | else |
321 | setup_rt_frame(sig, ka, NULL, oldset, regs); | 324 | ret = setup_rt_frame(sig, ka, NULL, oldset, regs); |
325 | |||
326 | if (ret) | ||
327 | return ret; | ||
322 | 328 | ||
323 | if (!(ka->sa.sa_flags & SA_NODEFER)) { | 329 | spin_lock_irq(¤t->sighand->siglock); |
324 | spin_lock_irq(¤t->sighand->siglock); | 330 | sigorsets(¤t->blocked, ¤t->blocked, &ka->sa.sa_mask); |
325 | sigorsets(¤t->blocked, | 331 | if (!(ka->sa.sa_flags & SA_NODEFER)) |
326 | ¤t->blocked, &ka->sa.sa_mask); | ||
327 | sigaddset(¤t->blocked, sig); | 332 | sigaddset(¤t->blocked, sig); |
328 | recalc_sigpending(); | 333 | recalc_sigpending(); |
329 | spin_unlock_irq(¤t->sighand->siglock); | 334 | spin_unlock_irq(¤t->sighand->siglock); |
330 | } | 335 | |
331 | return 1; | 336 | return 0; |
332 | } | 337 | } |
333 | 338 | ||
334 | /* | 339 | /* |
@@ -369,7 +374,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset, int in_syscall) | |||
369 | /* Whee! Actually deliver the signal. */ | 374 | /* Whee! Actually deliver the signal. */ |
370 | if (in_syscall) | 375 | if (in_syscall) |
371 | handle_restart(regs, &ka, 1); | 376 | handle_restart(regs, &ka, 1); |
372 | if (handle_signal(signr, &ka, &info, oldset, regs)) { | 377 | if (!handle_signal(signr, &ka, &info, oldset, regs)) { |
373 | /* | 378 | /* |
374 | * A signal was successfully delivered; the saved | 379 | * A signal was successfully delivered; the saved |
375 | * sigmask will have been stored in the signal frame, | 380 | * sigmask will have been stored in the signal frame, |