diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2013-01-09 23:34:08 +0100 |
---|---|---|
committer | Steven Rostedt <rostedt@rostedt.homelinux.com> | 2013-08-16 22:00:19 -0400 |
commit | f377319e75774ca2c17f475d22896dbec994c179 (patch) | |
tree | 792fce7dbc9f1a5c10b2e170afe65de5a8e0f8b2 | |
parent | cff9d509faaca839c3d07f84f10ca16c14c87246 (diff) | |
download | linux-rt-f377319e75774ca2c17f475d22896dbec994c179.tar.gz |
sched: Check for idle task in might_sleep()
Idle is not allowed to call sleeping functions ever!
Cc: stable-rt@vger.kernel.org
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | kernel/sched.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 18f70b16e362..dbd9a43d859f 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -8947,7 +8947,8 @@ void __might_sleep(const char *file, int line, int preempt_offset) static unsigned long prev_jiffy; /* ratelimiting */ rcu_sleep_check(); /* WARN_ON_ONCE() by default, no rate limit reqd. */ - if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) || + if ((preempt_count_equals(preempt_offset) && !irqs_disabled() && + !is_idle_task(current)) || system_state != SYSTEM_RUNNING || oops_in_progress) return; if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy) |