diff options
-rw-r--r-- | kernel/ptrace.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 2df115790cd9..4f689cb739a3 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -184,7 +184,6 @@ bool ptrace_may_access(struct task_struct *task, unsigned int mode) | |||
184 | 184 | ||
185 | static int ptrace_attach(struct task_struct *task) | 185 | static int ptrace_attach(struct task_struct *task) |
186 | { | 186 | { |
187 | bool wait_trap = false; | ||
188 | int retval; | 187 | int retval; |
189 | 188 | ||
190 | audit_ptrace(task); | 189 | audit_ptrace(task); |
@@ -246,7 +245,6 @@ static int ptrace_attach(struct task_struct *task) | |||
246 | if (task_is_stopped(task)) { | 245 | if (task_is_stopped(task)) { |
247 | task->group_stop |= GROUP_STOP_PENDING | GROUP_STOP_TRAPPING; | 246 | task->group_stop |= GROUP_STOP_PENDING | GROUP_STOP_TRAPPING; |
248 | signal_wake_up(task, 1); | 247 | signal_wake_up(task, 1); |
249 | wait_trap = true; | ||
250 | } | 248 | } |
251 | 249 | ||
252 | spin_unlock(&task->sighand->siglock); | 250 | spin_unlock(&task->sighand->siglock); |
@@ -257,7 +255,7 @@ unlock_tasklist: | |||
257 | unlock_creds: | 255 | unlock_creds: |
258 | mutex_unlock(&task->signal->cred_guard_mutex); | 256 | mutex_unlock(&task->signal->cred_guard_mutex); |
259 | out: | 257 | out: |
260 | if (wait_trap) | 258 | if (!retval) |
261 | wait_event(current->signal->wait_chldexit, | 259 | wait_event(current->signal->wait_chldexit, |
262 | !(task->group_stop & GROUP_STOP_TRAPPING)); | 260 | !(task->group_stop & GROUP_STOP_TRAPPING)); |
263 | return retval; | 261 | return retval; |