summaryrefslogtreecommitdiffstats
path: root/kernel/sched_rt.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2009-01-31 13:51:24 +0100
committerIngo Molnar <mingo@elte.hu>2009-02-01 10:49:52 +0100
commit3d398703ef06fd97b4c28c86b580546d5b57e7b7 (patch)
tree8d0d22c32d4610392af39a8184e38971554e7e5b /kernel/sched_rt.c
parentsched: fix buddie group latency (diff)
downloadlinux-3d398703ef06fd97b4c28c86b580546d5b57e7b7.tar.xz
linux-3d398703ef06fd97b4c28c86b580546d5b57e7b7.zip
sched_rt: don't use first_cpu on cpumask created with cpumask_and
cpumask_and() only initializes nr_cpu_ids bits, so the (deprecated) first_cpu() might find one of those uninitialized bits if nr_cpu_ids is less than NR_CPUS (as it can be for CONFIG_CPUMASK_OFFSTACK). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/sched_rt.c')
-rw-r--r--kernel/sched_rt.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 954e1a81b796..bac1061cea2f 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -968,8 +968,8 @@ static inline int pick_optimal_cpu(int this_cpu, cpumask_t *mask)
if ((this_cpu != -1) && cpu_isset(this_cpu, *mask))
return this_cpu;
- first = first_cpu(*mask);
- if (first != NR_CPUS)
+ first = cpumask_first(mask);
+ if (first < nr_cpu_ids)
return first;
return -1;