fix potential NULL derference of doms_cur
PATCH 1/1 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 <[email protected]>
--- kernel/sched.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched.c +1 -1
@@ -9329,6 +9329,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 **),
@@ -9360,7 +9361,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
Signature · 1 line
1.6.0.4
[tip:sched/urgent] sched: Fix potential NULL derference of doms_cur
Commit-ID: cb5fd13f1178dee4302646b2890d884c380160e1 Gitweb: http://git.kernel.org/tip/cb5fd13f1178dee4302646b2890d884c380160e1 Author: Yong Zhang <[email protected]> AuthorDate: Mon, 14 Sep 2009 20:20:16 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Sun, 20 Sep 2009 20:20:30 +0200
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 <[email protected]>
LKML-Reference: <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/sched.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched.c +1 -1
@@ -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