From 1486029e0f35bbeec3ca42ca0ebce3c008db38d2 Mon Sep 17 00:00:00 2001 From: Jeremy Fitzhardinge Date: Sun, 3 Aug 2008 09:33:03 -0700 Subject: [PATCH] --- yaml --- r: 107575 b: refs/heads/master c: 725aad24c3ba96a7c06448c14c265a466cdbd663 h: refs/heads/master i: 107573: a3354a5a25a12b66a0530f7822473871057920ac 107571: 6d370553442264c60e362dafcde7c365a578b5ed 107567: e25d5d740ba0d6393a210c5ad6f314733bb129f5 v: v3 --- [refs] | 2 +- trunk/kernel/sched.c | 22 ++++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/[refs] b/[refs] index 98cb12cfa0cb..3759f0c24929 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5941de8eadc287f3f47b87ce9888734ee07d210b +refs/heads/master: 725aad24c3ba96a7c06448c14c265a466cdbd663 diff --git a/trunk/kernel/sched.c b/trunk/kernel/sched.c index 21f7da94662e..04160d277e7a 100644 --- a/trunk/kernel/sched.c +++ b/trunk/kernel/sched.c @@ -5004,19 +5004,21 @@ static int __sched_setscheduler(struct task_struct *p, int policy, return -EPERM; } + if (user) { #ifdef CONFIG_RT_GROUP_SCHED - /* - * Do not allow realtime tasks into groups that have no runtime - * assigned. - */ - if (user - && rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0) - return -EPERM; + /* + * Do not allow realtime tasks into groups that have no runtime + * assigned. + */ + if (rt_policy(policy) && task_group(p)->rt_bandwidth.rt_runtime == 0) + return -EPERM; #endif - retval = security_task_setscheduler(p, policy, param); - if (retval) - return retval; + retval = security_task_setscheduler(p, policy, param); + if (retval) + return retval; + } + /* * make sure no PI-waiters arrive (or leave) while we are * changing the priority of the task: