Skip to content

Commit

Permalink
ACPI: get_throttling_state() cannot be larger than state_count
Browse files Browse the repository at this point in the history
Reported-by: Roel Kluin <roel.kluin@gmail.com>
Acked-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Len Brown authored and Len Brown committed Apr 3, 2009
1 parent 2a9ef8e commit 53af9cf
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/acpi/processor_throttling.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,11 +783,9 @@ static int acpi_get_throttling_state(struct acpi_processor *pr,
(struct acpi_processor_tx_tss *)&(pr->throttling.
states_tss[i]);
if (tx->control == value)
break;
return i;
}
if (i > pr->throttling.state_count)
i = -1;
return i;
return -1;
}

static int acpi_get_throttling_value(struct acpi_processor *pr,
Expand Down

0 comments on commit 53af9cf

Please sign in to comment.