aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/ptrace.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2011-10-04 11:08:16 +0200
committerIngo Molnar <mingo@elte.hu>2011-10-04 11:09:08 +0200
commit22f92bacbeea24b20e447444c28e7cad9f1ac3f8 (patch)
tree5c3f2346804a186aa2d954f078fd2f4d44bcc26e /kernel/ptrace.c
parentsched, tracing: Show PREEMPT_ACTIVE state in trace_sched_switch (diff)
parentMerge branch 'hwmon-for-linus' of git://github.com/groeck/linux (diff)
downloadlinux-dev-22f92bacbeea24b20e447444c28e7cad9f1ac3f8.tar.xz
linux-dev-22f92bacbeea24b20e447444c28e7cad9f1ac3f8.zip
Merge branch 'linus' into sched/core
Merge reason: pick up the latest fixes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/ptrace.c')
-rw-r--r--kernel/ptrace.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 9de3ecfd20f9..a70d2a5d8c7b 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -744,20 +744,17 @@ int ptrace_request(struct task_struct *child, long request,
break;
si = child->last_siginfo;
- if (unlikely(!si || si->si_code >> 8 != PTRACE_EVENT_STOP))
- break;
-
- child->jobctl |= JOBCTL_LISTENING;
-
- /*
- * If NOTIFY is set, it means event happened between start
- * of this trap and now. Trigger re-trap immediately.
- */
- if (child->jobctl & JOBCTL_TRAP_NOTIFY)
- signal_wake_up(child, true);
-
+ if (likely(si && (si->si_code >> 8) == PTRACE_EVENT_STOP)) {
+ child->jobctl |= JOBCTL_LISTENING;
+ /*
+ * If NOTIFY is set, it means event happened between
+ * start of this trap and now. Trigger re-trap.
+ */
+ if (child->jobctl & JOBCTL_TRAP_NOTIFY)
+ signal_wake_up(child, true);
+ ret = 0;
+ }
unlock_task_sighand(child, &flags);
- ret = 0;
break;
case PTRACE_DETACH: /* detach a process that was attached. */