Displaying 1 result from an estimated 1 matches for "get_cur_val".
2010 Jul 06
0
[PATCH] x86/cpufreq: check array index before use
... rather than after.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- 2010-06-15.orig/xen/arch/x86/acpi/cpufreq/cpufreq.c 2010-07-06 16:08:59.000000000 +0200
+++ 2010-06-15/xen/arch/x86/acpi/cpufreq/cpufreq.c 2010-07-06 16:11:48.000000000 +0200
@@ -210,9 +210,11 @@ static u32 get_cur_val(cpumask_t mask)
if (!cpu_isset(cpu, mask))
cpu = first_cpu(mask);
- policy = cpufreq_cpu_policy[cpu];
+ if (cpu >= NR_CPUS)
+ return 0;
- if (cpu >= NR_CPUS || !policy || !drv_data[policy->cpu])
+ policy = cpufreq_cpu_policy[cpu];
+ if (!policy || !d...