aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index b8b9a7dac9b0..70bec4f1edbb 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5946,13 +5946,15 @@ int set_cpus_allowed_ptr(struct task_struct *p, const struct cpumask *new_mask)
5946 5946
5947 rq = task_rq_lock(p, &flags); 5947 rq = task_rq_lock(p, &flags);
5948 5948
5949 if (cpumask_equal(&p->cpus_allowed, new_mask))
5950 goto out;
5951
5949 if (!cpumask_intersects(new_mask, cpu_active_mask)) { 5952 if (!cpumask_intersects(new_mask, cpu_active_mask)) {
5950 ret = -EINVAL; 5953 ret = -EINVAL;
5951 goto out; 5954 goto out;
5952 } 5955 }
5953 5956
5954 if (unlikely((p->flags & PF_THREAD_BOUND) && p != current && 5957 if (unlikely((p->flags & PF_THREAD_BOUND) && p != current)) {
5955 !cpumask_equal(&p->cpus_allowed, new_mask))) {
5956 ret = -EINVAL; 5958 ret = -EINVAL;
5957 goto out; 5959 goto out;
5958 } 5960 }