diff --git a/kernel/kernel.c b/kernel/kernel.c index d46ab98..b2159e8 100644 --- a/kernel/kernel.c +++ b/kernel/kernel.c @@ -146,7 +146,8 @@ inline void preempt_count_inc(void) inline void preempt_count_dec(void) { - preempt_cnt--; + if (preempt_cnt > 0) + preempt_cnt--; } void preempt_disable(void)