diff options
author | Len Brown <len.brown@intel.com> | 2009-04-23 23:21:29 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-04-23 23:21:29 -0400 |
commit | 615dfd93e2346b604232b559e7ea0835d24abe26 (patch) | |
tree | eed079ff4006c40d882e19533370e36fbb74969d /drivers/acpi/processor_idle.c | |
parent | 091069740304c979f957ceacec39c461d0192158 (diff) |
ACPI: prevent processor.max_cstate=0 boot crash
As processor.max_cstate is an init-time-only modparam,
sanity checking it at init-time is sufficient.
http://bugzilla.kernel.org/show_bug.cgi?id=13142
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/processor_idle.c')
-rw-r--r-- | drivers/acpi/processor_idle.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 6fe121434ffb..436127e0eec3 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -1037,6 +1037,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr) | |||
1037 | dev->states[i].desc[0] = '\0'; | 1037 | dev->states[i].desc[0] = '\0'; |
1038 | } | 1038 | } |
1039 | 1039 | ||
1040 | if (max_cstate == 0) | ||
1041 | max_cstate = 1; | ||
1042 | |||
1040 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { | 1043 | for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) { |
1041 | cx = &pr->power.states[i]; | 1044 | cx = &pr->power.states[i]; |
1042 | state = &dev->states[count]; | 1045 | state = &dev->states[count]; |