From: Yong Zhang Date: Mon, 14 Sep 2009 12:20:16 +0000 (+0800) Subject: sched: Fix potential NULL derference of doms_cur X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=cb5fd13f1178dee4302646b2890d884c380160e1;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git 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 Cc: a.p.zijlstra@chello.nl LKML-Reference: <1252930816-7672-1-git-send-email-yong.zhang0@gmail.com> Signed-off-by: Ingo Molnar --- diff --git a/kernel/sched.c b/kernel/sched.c index 575fb013903..1b900fb1c6e 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -9165,6 +9165,7 @@ void __init sched_init_smp(void) cpumask_var_t non_isolated_cpus; alloc_cpumask_var(&non_isolated_cpus, GFP_KERNEL); + alloc_cpumask_var(&fallback_doms, GFP_KERNEL); #if defined(CONFIG_NUMA) sched_group_nodes_bycpu = kzalloc(nr_cpu_ids * sizeof(void **), @@ -9196,7 +9197,6 @@ void __init sched_init_smp(void) sched_init_granularity(); free_cpumask_var(non_isolated_cpus); - alloc_cpumask_var(&fallback_doms, GFP_KERNEL); init_sched_rt_class(); } #else