From a71d72ce287f506a799f953d373b554f119ef3a5 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Thu, 29 Jan 2004 16:24:26 -0800 Subject: [PATCH] [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. --- arch/i386/kernel/cpu/cpufreq/acpi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/i386/kernel/cpu/cpufreq/acpi.c b/arch/i386/kernel/cpu/cpufreq/acpi.c index f5b7830e48dd4..7d77643a4ee18 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, -- 2.53.0