diff options
author | Scott Wood <scottwood@freescale.com> | 2014-05-14 18:11:24 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-05-14 18:12:24 (GMT) |
commit | ffb069a30665ec06c05916355bc3252e33fc863b (patch) | |
tree | ba7b82696000c0f2983672d22966b83112da874e /kernel/exit.c | |
parent | 8d5cd1658cb0c97d5429124f9fb5caa88c460186 (diff) | |
parent | 3756888c2a2da9c7291d39cacd1184171111b49d (diff) | |
download | linux-fsl-qoriq-ffb069a30665ec06c05916355bc3252e33fc863b.tar.xz |
Merge remote-tracking branch 'stable/linux-3.12.y' into sdk-v1.6.x
Signed-off-by: Scott Wood <scottwood@freescale.com>
Conflicts:
arch/sparc/Kconfig
drivers/tty/tty_buffer.c
Diffstat (limited to 'kernel/exit.c')
-rw-r--r-- | kernel/exit.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 7493b32..1403fdc 100644 --- a/kernel/exit.c +++ b/kernel/exit.c @@ -559,9 +559,6 @@ static void reparent_leader(struct task_struct *father, struct task_struct *p, struct list_head *dead) { list_move_tail(&p->sibling, &p->real_parent->children); - - if (p->exit_state == EXIT_DEAD) - return; /* * If this is a threaded reparent there is no need to * notify anyone anything has happened. @@ -569,9 +566,19 @@ static void reparent_leader(struct task_struct *father, struct task_struct *p, if (same_thread_group(p->real_parent, father)) return; - /* We don't want people slaying init. */ + /* + * We don't want people slaying init. + * + * Note: we do this even if it is EXIT_DEAD, wait_task_zombie() + * can change ->exit_state to EXIT_ZOMBIE. If this is the final + * state, do_notify_parent() was already called and ->exit_signal + * doesn't matter. + */ p->exit_signal = SIGCHLD; + if (p->exit_state == EXIT_DEAD) + return; + /* If it has exited notify the new parent about this child's death. */ if (!p->ptrace && p->exit_state == EXIT_ZOMBIE && thread_group_empty(p)) { @@ -783,6 +790,8 @@ void do_exit(long code) exit_shm(tsk); exit_files(tsk); exit_fs(tsk); + if (group_dead) + disassociate_ctty(1); exit_task_namespaces(tsk); exit_task_work(tsk); check_stack_usage(); @@ -798,13 +807,9 @@ void do_exit(long code) cgroup_exit(tsk, 1); - if (group_dead) - disassociate_ctty(1); - module_put(task_thread_info(tsk)->exec_domain->module); proc_exit_connector(tsk); - /* * FIXME: do that only when needed, using sched_exit tracepoint */ |