[PATCH] drivers/isdn/gigaset: reduce kernel message spam
[linux-2.6-block.git] / kernel / exit.c
index 46cf6b6814605fc1fa83871ce30cb0763d74ef99..bc71fdfcd8a78d4a6b0f466b11f55cb8354bacdd 100644 (file)
@@ -257,8 +257,7 @@ static int has_stopped_jobs(int pgrp)
 }
 
 /**
- * reparent_to_init - Reparent the calling kernel thread to the init task
- * of the pid space that the thread belongs to.
+ * reparent_to_init - Reparent the calling kernel thread to the init task of the pid space that the thread belongs to.
  *
  * If a kernel thread is launched as a result of a system call, or if
  * it ever exits, it should generally reparent itself to init so that
@@ -597,6 +596,10 @@ choose_new_parent(struct task_struct *p, struct task_struct *reaper)
 static void
 reparent_thread(struct task_struct *p, struct task_struct *father, int traced)
 {
+       if (p->pdeath_signal)
+               /* We already hold the tasklist_lock here.  */
+               group_send_sig_info(p->pdeath_signal, SEND_SIG_NOINFO, p);
+
        /* Move the child from its dying parent to the new one.  */
        if (unlikely(traced)) {
                /* Preserve ptrace links if someone else is tracing this child.  */
@@ -631,10 +634,6 @@ reparent_thread(struct task_struct *p, struct task_struct *father, int traced)
        /* We don't want people slaying init.  */
        if (p->exit_signal != -1)
                p->exit_signal = SIGCHLD;
-               
-       if (p->pdeath_signal)
-               /* We already hold the tasklist_lock here.  */
-               group_send_sig_info(p->pdeath_signal, SEND_SIG_NOINFO, p);
 
        /* If we'd notified the old parent about this child's death,
         * also notify the new parent.
@@ -938,8 +937,8 @@ fastcall NORET_TYPE void do_exit(long code)
 
        tsk->exit_code = code;
        proc_exit_connector(tsk);
-       exit_notify(tsk);
        exit_task_namespaces(tsk);
+       exit_notify(tsk);
 #ifdef CONFIG_NUMA
        mpol_free(tsk->mempolicy);
        tsk->mempolicy = NULL;