projects
/
xen.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
876e14e
)
x86/cpufreq: check array index before use
author
Keir Fraser
<keir.fraser@citrix.com>
Thu, 8 Jul 2010 08:44:46 +0000
(09:44 +0100)
committer
Keir Fraser
<keir.fraser@citrix.com>
Thu, 8 Jul 2010 08:44:46 +0000
(09:44 +0100)
... rather than after.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/arch/x86/acpi/cpufreq/cpufreq.c
patch
|
blob
|
history
diff --git
a/xen/arch/x86/acpi/cpufreq/cpufreq.c
b/xen/arch/x86/acpi/cpufreq/cpufreq.c
index a9b1d239a227f08a58729cc5ac065741e066e3ab..d9697ddf3229d2367e4eeec3a6d9926f1fe02e7d 100644
(file)
--- a/
xen/arch/x86/acpi/cpufreq/cpufreq.c
+++ b/
xen/arch/x86/acpi/cpufreq/cpufreq.c
@@
-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 || !drv_data[policy->cpu])
return 0;
switch (drv_data[policy->cpu]->cpu_feature) {