]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] cpufreq crashes on P4
authorDominik Brodowski <linux@brodo.de>
Mon, 30 Sep 2002 07:10:35 +0000 (00:10 -0700)
committerJeff Garzik <jgarzik@mandrakesoft.com>
Mon, 30 Sep 2002 07:10:35 +0000 (00:10 -0700)
In two drivers a wrong size of memory was allocated for cpufreq_driver: as
it must include NR_CPUS times a struct cpufreq_policy (and not struct
cpufreq_freqs). Thanks to Petr Vandrovec for this patch.

arch/i386/kernel/cpu/cpufreq/p4-clockmod.c
arch/i386/kernel/cpu/cpufreq/powernow-k6.c

index 6285c68444f64c192920913138a60c239094a98c..3aa413684ba847827799317774ad3a5fb9450023 100644 (file)
@@ -221,7 +221,7 @@ int __init cpufreq_p4_init(void)
 
        printk(KERN_INFO PFX "P4/Xeon(TM) CPU On-Demand Clock Modulation available\n");
        driver = kmalloc(sizeof(struct cpufreq_driver) +
-                        NR_CPUS * sizeof(struct cpufreq_freqs), GFP_KERNEL);
+                        NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL);
        if (!driver)
                return -ENOMEM;
 
index 57e277b57833fb13f405d6839c14abe51c034378..2f77db051412269ee8af1124f23846f32faeba8d 100644 (file)
@@ -234,7 +234,7 @@ static int __init powernow_k6_init(void)
 
        /* initialization of main "cpufreq" code*/
        driver = kmalloc(sizeof(struct cpufreq_driver) +
-                        NR_CPUS * sizeof(struct cpufreq_freqs), GFP_KERNEL);
+                        NR_CPUS * sizeof(struct cpufreq_policy), GFP_KERNEL);
        if (!driver) {
                release_region (POWERNOW_IOPORT, 16);
                return -ENOMEM;