aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index f9b3c6a414f1..c3c718aea618 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4109,8 +4109,7 @@ recheck:
4109 (p->mm && param->sched_priority > MAX_USER_RT_PRIO-1) || 4109 (p->mm && param->sched_priority > MAX_USER_RT_PRIO-1) ||
4110 (!p->mm && param->sched_priority > MAX_RT_PRIO-1)) 4110 (!p->mm && param->sched_priority > MAX_RT_PRIO-1))
4111 return -EINVAL; 4111 return -EINVAL;
4112 if ((policy == SCHED_NORMAL || policy == SCHED_BATCH) 4112 if (is_rt_policy(policy) != (param->sched_priority != 0))
4113 != (param->sched_priority == 0))
4114 return -EINVAL; 4113 return -EINVAL;
4115 4114
4116 /* 4115 /*
@@ -4134,7 +4133,7 @@ recheck:
4134 !rlim_rtprio) 4133 !rlim_rtprio)
4135 return -EPERM; 4134 return -EPERM;
4136 /* can't increase priority */ 4135 /* can't increase priority */
4137 if ((policy != SCHED_NORMAL && policy != SCHED_BATCH) && 4136 if (is_rt_policy(policy) &&
4138 param->sched_priority > p->rt_priority && 4137 param->sched_priority > p->rt_priority &&
4139 param->sched_priority > rlim_rtprio) 4138 param->sched_priority > rlim_rtprio)
4140 return -EPERM; 4139 return -EPERM;