aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/sched.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 170237e3a4..c52f1b3000 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4537,10 +4537,11 @@ long sched_setaffinity(pid_t pid, cpumask_t new_mask)
4537 read_lock(&tasklist_lock); 4537 read_lock(&tasklist_lock);
4538 4538
4539 p = find_process_by_pid(pid); 4539 p = find_process_by_pid(pid);
4540 if (!p) { 4540 if (!p || is_realtime(p)) {
4541 /* LITMUS tasks don't get to do this, transition to BE first */
4541 read_unlock(&tasklist_lock); 4542 read_unlock(&tasklist_lock);
4542 mutex_unlock(&sched_hotcpu_mutex); 4543 mutex_unlock(&sched_hotcpu_mutex);
4543 return -ESRCH; 4544 return p ? -EPERM : -ESRCH;
4544 } 4545 }
4545 4546
4546 /* 4547 /*