Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cb5fd13f authored by Yong Zhang's avatar Yong Zhang Committed by Ingo Molnar
Browse files

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: default avatarYong 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: default avatarIngo Molnar <mingo@elte.hu>
parent 89f19f04
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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