Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 68cb9478 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Linus Torvalds
Browse files

ptrace: __ptrace_unlink: use the ptrace_reparented() helper



Currently __ptrace_unlink() checks list_empty(->ptrace_list) to figure out
whether the child was reparented.  Change the code to use ptrace_reparented()
to make this check more explicit and consistent.

No functional changes.

Signed-off-by: default avatarOleg Nesterov <oleg@tv-sign.ru>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 53b6f9fb
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -73,7 +73,7 @@ void __ptrace_unlink(struct task_struct *child)
	BUG_ON(!child->ptrace);
	BUG_ON(!child->ptrace);


	child->ptrace = 0;
	child->ptrace = 0;
	if (!list_empty(&child->ptrace_list)) {
	if (ptrace_reparented(child)) {
		list_del_init(&child->ptrace_list);
		list_del_init(&child->ptrace_list);
		remove_parent(child);
		remove_parent(child);
		child->parent = child->real_parent;
		child->parent = child->real_parent;