sched: improve preempt debugging
[safe/jmp/linux-2.6] / kernel / sched.c
index 9889080..ec3bd1f 100644 (file)
@@ -4305,7 +4305,7 @@ void __kprobes sub_preempt_count(int val)
        /*
         * Underflow?
         */
-       if (DEBUG_LOCKS_WARN_ON(val > preempt_count()))
+       if (DEBUG_LOCKS_WARN_ON(val > preempt_count() - (!!kernel_locked())))
                return;
        /*
         * Is the spinlock portion underflowing?