sched/core: Robustify preemption leak checks
[linux-2.6-block.git] / kernel / exit.c
index ea95ee1b5ef7038ec1ade3f5cd5d98181177f22f..443677c8efe6ec17ac11dc2fe699f0fcb61fa107 100644 (file)
@@ -706,10 +706,12 @@ void do_exit(long code)
        smp_mb();
        raw_spin_unlock_wait(&tsk->pi_lock);
 
-       if (unlikely(in_atomic()))
+       if (unlikely(in_atomic())) {
                pr_info("note: %s[%d] exited with preempt_count %d\n",
                        current->comm, task_pid_nr(current),
                        preempt_count());
+               preempt_count_set(PREEMPT_ENABLED);
+       }
 
        /* sync mm's RSS info before statistics gathering */
        if (tsk->mm)