aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYong Zhang <yong.zhang0@gmail.com>2009-09-14 08:20:16 -0400
committerIngo Molnar <mingo@elte.hu>2009-09-20 14:20:30 -0400
commitcb5fd13f1178dee4302646b2890d884c380160e1 (patch)
tree473960daef1977f2bff85c21d0f5ed9f84d35ebd
parent89f19f04dc72363d912fd007a399cb10310eff6e (diff)
sched: Fix potential NULL derference of doms_cur
If CONFIG_CPUMASK_OFFSTACK is enabled but doms_cur alloc failed in arch_init_sched_domains(), doms_cur will move back to fallback_doms. But this time, fallback_doms has not been initialized yet. Signed-off-by: Yong Zhang <yong.zhang0@gmail.com> Cc: a.p.zijlstra@chello.nl LKML-Reference: <1252930816-7672-1-git-send-email-yong.zhang0@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--kernel/sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index 575fb0139038..1b900fb1c6e1 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -9165,6 +9165,7 @@ void __init sched_init_smp(void)
9165 cpumask_var_t non_isolated_cpus; 9165 cpumask_var_t non_isolated_cpus;
9166 9166
9167 alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL); 9167 alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL);
9168 alloc_cpumask_var(&fallback_doms, GFP_KERNEL);
9168 9169
9169#if defined(CONFIG_NUMA) 9170#if defined(CONFIG_NUMA)
9170 sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **), 9171 sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **),
@@ -9196,7 +9197,6 @@ void __init sched_init_smp(void)
9196 sched_init_granularity(); 9197 sched_init_granularity();
9197 free_cpumask_var(non_isolated_cpus); 9198 free_cpumask_var(non_isolated_cpus);
9198 9199
9199 alloc_cpumask_var(&fallback_doms, GFP_KERNEL);
9200 init_sched_rt_class(); 9200 init_sched_rt_class();
9201} 9201}
9202#else 9202#else