Skip to content

Commit

Permalink
[PATCH] choose_new_parent: remove unused arg, sanitize exit_state check
Browse files Browse the repository at this point in the history
'child_reaper' arg is not used in choose_new_parent().

"->exit_state >= EXIT_ZOMBIE" check is a leftover, was
valid when EXIT_ZOMBIE lived in ->state var.

Signed-off-by: Oleg Nesterov <[email protected]>
Acked-by: Eric Biederman <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Mar 29, 2006
1 parent d73d652 commit d799f03
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions kernel/exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,13 +538,13 @@ static void exit_mm(struct task_struct * tsk)
mmput(mm);
}

static inline void choose_new_parent(task_t *p, task_t *reaper, task_t *child_reaper)
static inline void choose_new_parent(task_t *p, task_t *reaper)
{
/*
* Make sure we're not reparenting to ourselves and that
* the parent is not a zombie.
*/
BUG_ON(p == reaper || reaper->exit_state >= EXIT_ZOMBIE);
BUG_ON(p == reaper || reaper->exit_state);
p->real_parent = reaper;
}

Expand Down Expand Up @@ -645,7 +645,7 @@ static void forget_original_parent(struct task_struct * father,

if (father == p->real_parent) {
/* reparent with a reaper, real father it's us */
choose_new_parent(p, reaper, child_reaper);
choose_new_parent(p, reaper);
reparent_thread(p, father, 0);
} else {
/* reparent ptraced task to its real parent */
Expand All @@ -666,7 +666,7 @@ static void forget_original_parent(struct task_struct * father,
}
list_for_each_safe(_p, _n, &father->ptrace_children) {
p = list_entry(_p,struct task_struct,ptrace_list);
choose_new_parent(p, reaper, child_reaper);
choose_new_parent(p, reaper);
reparent_thread(p, father, 1);
}
}
Expand Down

0 comments on commit d799f03

Please sign in to comment.