Commit 7886396c authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Extra sanity checks in longhaul.

parent f9d4835b
...@@ -256,6 +256,16 @@ static int __init longhaul_get_ranges (void) ...@@ -256,6 +256,16 @@ static int __init longhaul_get_ranges (void)
dprintk (KERN_INFO PFX "FSB: %dMHz Lowestspeed=%dMHz Highestspeed=%dMHz\n", dprintk (KERN_INFO PFX "FSB: %dMHz Lowestspeed=%dMHz Highestspeed=%dMHz\n",
fsb, lowest_speed/1000, highest_speed/1000); fsb, lowest_speed/1000, highest_speed/1000);
if (lowest_speed == highest_speed) {
printk (KERN_INFO PFX "highestspeed == lowest, aborting.\n");
return -EINVAL;
}
if (lowest_speed > highest_speed) {
printk (KERN_INFO PFX "nonsense! lowest (%d > %d) !\n",
lowest_speed, highest_speed);
return -EINVAL;
}
longhaul_table = kmalloc((numscales + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL); longhaul_table = kmalloc((numscales + 1) * sizeof(struct cpufreq_frequency_table), GFP_KERNEL);
if(!longhaul_table) if(!longhaul_table)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment