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-Tag: v2.6.30-rc1~199^2~4^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53af9cfb37af5e03ee2b24c5d5c4963c34e5b765;p=platform%2Fkernel%2Flinux-3.10.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 d278381..5f099012 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,