]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Validate ACPI CPU frequency values
authorDominik Brodowski <linux@dominikbrodowski.de>
Fri, 30 Jan 2004 00:24:26 +0000 (16:24 -0800)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 30 Jan 2004 00:24:26 +0000 (16:24 -0800)
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

index f5b7830e48dd468e673547d372e8042533da572f..7d77643a4ee18566bf5b9f46311c4da6658c1e92 100644 (file)
@@ -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,