Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=97b6ea7b6369d51a451a7d5747a7939a593fdd9c
Commit:     97b6ea7b6369d51a451a7d5747a7939a593fdd9c
Parent:     5cf9f062c8e33d5a09eaa447550330162b2a96ed
Author:     Milton Miller <[EMAIL PROTECTED]>
AuthorDate: Mon Oct 15 17:00:19 2007 +0200
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Mon Oct 15 17:00:19 2007 +0200

    sched: domain sysctl fixes: use for_each_online_cpu()
    
    init_sched_domain_sysctl was walking cpus 0-n and referencing per_cpu
    variables.  If the cpus_possible mask is not contigious this will result
    in a crash referencing unallocated data.  If the online mask is not
    contigious then we would show offline cpus and miss online ones.
    
    Signed-off-by: Milton Miller <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/sched.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/sched.c b/kernel/sched.c
index d29950a..374f421 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -5326,11 +5326,12 @@ static void init_sched_domain_sysctl(void)
 
        sd_ctl_dir[0].child = entry;
 
-       for (i = 0; i < cpu_num; i++, entry++) {
+       for_each_online_cpu(i) {
                snprintf(buf, 32, "cpu%d", i);
                entry->procname = kstrdup(buf, GFP_KERNEL);
                entry->mode = 0555;
                entry->child = sd_alloc_ctl_cpu_table(i);
+               entry++;
        }
        sd_sysctl_header = register_sysctl_table(sd_ctl_root);
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to