Skip to content

Commit

Permalink
ACPI: prevent processor.max_cstate=0 boot crash
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Len Brown committed Apr 24, 2009
1 parent 0910697 commit 615dfd9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,9 @@ static int acpi_processor_setup_cpuidle(struct acpi_processor *pr)
dev->states[i].desc[0] = '\0';
}

if (max_cstate == 0)
max_cstate = 1;

for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
cx = &pr->power.states[i];
state = &dev->states[count];
Expand Down

0 comments on commit 615dfd9

Please sign in to comment.