From 53af9cfb37af5e03ee2b24c5d5c4963c34e5b765 Mon Sep 17 00:00:00 2001 From: Len Brown Date: Sun, 15 Mar 2009 23:36:38 -0400 Subject: [PATCH] ACPI: get_throttling_state() cannot be larger than state_count Reported-by: Roel Kluin Acked-by: Zhao Yakui Signed-off-by: Len Brown --- drivers/acpi/processor_throttling.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/acpi/processor_throttling.c b/drivers/acpi/processor_throttling.c index d27838171f4..5f099012f47 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, -- 2.41.1