mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] fix potential NULL derference of doms_cur
@ 2009-09-14 12:20 Yong Zhang
  2009-09-20 18:29 ` [tip:sched/urgent] sched: Fix " tip-bot for Yong Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Yong Zhang @ 2009-09-14 12:20 UTC (permalink / raw)
  To: a.p.zijlstra, mingo; +Cc: linux-kernel

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>
---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index e27a536..6dc3e06 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -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
-- 
1.6.0.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [tip:sched/urgent] sched: Fix potential NULL derference of doms_cur
  2009-09-14 12:20 [PATCH] fix potential NULL derference of doms_cur Yong Zhang
@ 2009-09-20 18:29 ` tip-bot for Yong Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Yong Zhang @ 2009-09-20 18:29 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, yong.zhang0, tglx, mingo

Commit-ID:  cb5fd13f1178dee4302646b2890d884c380160e1
Gitweb:     http://git.kernel.org/tip/cb5fd13f1178dee4302646b2890d884c380160e1
Author:     Yong Zhang <yong.zhang0@gmail.com>
AuthorDate: Mon, 14 Sep 2009 20:20:16 +0800
Committer:  Ingo Molnar <mingo@elte.hu>
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 <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>


---
 kernel/sched.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index 575fb01..1b900fb 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-09-20 18:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-14 12:20 [PATCH] fix potential NULL derference of doms_cur Yong Zhang
2009-09-20 18:29 ` [tip:sched/urgent] sched: Fix " tip-bot for Yong Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome