]> err.no Git - linux-2.6/blobdiff - kernel/exit.c
[PATCH] lockdep: add local_irq_enable_in_hardirq() API
[linux-2.6] / kernel / exit.c
index 304ef637be6c700e7b5d73172222a0e05e5f96d8..7f7ef2258553a76cb3ce9afdf777c195a648030a 100644 (file)
@@ -4,7 +4,6 @@
  *  Copyright (C) 1991, 1992  Linus Torvalds
  */
 
-#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/slab.h>
 #include <linux/interrupt.h>
@@ -925,10 +924,19 @@ fastcall NORET_TYPE void do_exit(long code)
        mpol_free(tsk->mempolicy);
        tsk->mempolicy = NULL;
 #endif
+       /*
+        * This must happen late, after the PID is not
+        * hashed anymore:
+        */
+       if (unlikely(!list_empty(&tsk->pi_state_list)))
+               exit_pi_state_list(tsk);
+       if (unlikely(current->pi_state_cache))
+               kfree(current->pi_state_cache);
        /*
         * If DEBUG_MUTEXES is on, make sure we are holding no locks:
         */
        mutex_debug_check_no_locks_held(tsk);
+       rt_mutex_debug_check_no_locks_held(tsk);
 
        if (tsk->io_context)
                exit_io_context();