summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.de>2004-01-29 16:24:26 -0800
committerLinus Torvalds <torvalds@home.osdl.org>2004-01-29 16:24:26 -0800
commita71d72ce287f506a799f953d373b554f119ef3a5 (patch)
tree9f1fe8f2a24b7c9502e90c36de19427c136ad39e
parent87903ac513143420876cf1310e352a532157e035 (diff)
[PATCH] Validate ACPI CPU frequency values
This is a simple fix for some of the problems with bad ACPI frequency values: Abort if the frequency field in _PSS is zero, as we're having a completely broken ACPI table then. A more complete overhaul of the acpi-cpufreq driver (where the cause of the problem lies) is in the latest acpi-test tree, but that's definitely something to be delayed for 2.6.3 -- and the same is true for the yet-to-be-written do_div64 conversion.
-rw-r--r--arch/i386/kernel/cpu/cpufreq/acpi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/acpi.c b/arch/i386/kernel/cpu/cpufreq/acpi.c
index f5b7830e48dd..7d77643a4ee1 100644
--- a/arch/i386/kernel/cpu/cpufreq/acpi.c
+++ b/arch/i386/kernel/cpu/cpufreq/acpi.c
@@ -208,6 +208,12 @@ acpi_processor_get_performance_states (
goto end;
}
+ if (!px->core_frequency) {
+ ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid _PSS data: freq is zero\n"));
+ result = -EFAULT;
+ goto end;
+ }
+
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"State [%d]: core_frequency[%d] power[%d] transition_latency[%d] bus_master_latency[%d] control[0x%x] status[0x%x]\n",
i,