From: Len Brown Date: Mon, 16 Mar 2009 03:36:38 +0000 (-0400) Subject: ACPI: get_throttling_state() cannot be larger than state_count X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=53af9cfb37af5e03ee2b24c5d5c4963c34e5b765;p=openwrt%2Fstaging%2Fblogic.git ACPI: get_throttling_state() cannot be larger than state_count Reported-by: Roel Kluin Acked-by: Zhao Yakui Signed-off-by: Len Brown --- diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index d27838171f4a..5f099012f471 100644 --- a/drivers/acpi/processor_throttling.c +++ b/drivers/acpi/processor_throttling.c @@ -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,