diff options
-rw-r--r-- | include/linux/ptrace.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index eae381d584f9..fd8669fc339f 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -217,16 +217,17 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace) | |||
217 | { | 217 | { |
218 | INIT_LIST_HEAD(&child->ptrace_entry); | 218 | INIT_LIST_HEAD(&child->ptrace_entry); |
219 | INIT_LIST_HEAD(&child->ptraced); | 219 | INIT_LIST_HEAD(&child->ptraced); |
220 | child->parent = child->real_parent; | 220 | #ifdef CONFIG_HAVE_HW_BREAKPOINT |
221 | atomic_set(&child->ptrace_bp_refcnt, 1); | ||
222 | #endif | ||
223 | child->jobctl = 0; | ||
221 | child->ptrace = 0; | 224 | child->ptrace = 0; |
222 | if (unlikely(ptrace) && (current->ptrace & PT_PTRACED)) { | 225 | child->parent = child->real_parent; |
226 | |||
227 | if (unlikely(ptrace) && current->ptrace) { | ||
223 | child->ptrace = current->ptrace; | 228 | child->ptrace = current->ptrace; |
224 | __ptrace_link(child, current->parent); | 229 | __ptrace_link(child, current->parent); |
225 | } | 230 | } |
226 | |||
227 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
228 | atomic_set(&child->ptrace_bp_refcnt, 1); | ||
229 | #endif | ||
230 | } | 231 | } |
231 | 232 | ||
232 | /** | 233 | /** |