diff options
-rw-r--r-- | kernel/sched/core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 1fe02e0e801c..8a82c61d83df 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -4113,9 +4113,9 @@ long sched_setaffinity(pid_t pid, const struct cpumask *in_mask) | |||
4113 | rcu_read_lock(); | 4113 | rcu_read_lock(); |
4114 | 4114 | ||
4115 | p = find_process_by_pid(pid); | 4115 | p = find_process_by_pid(pid); |
4116 | if (!p) { | 4116 | if (!p || is_realtime(p)) { |
4117 | rcu_read_unlock(); | 4117 | rcu_read_unlock(); |
4118 | return -ESRCH; | 4118 | return p ? -EPERM : -ESRCH; |
4119 | } | 4119 | } |
4120 | 4120 | ||
4121 | /* Prevent p going away */ | 4121 | /* Prevent p going away */ |