summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/processor_throttling.c
diff options
context:
space:
mode:
authorLen Brown <lenb@kernel.org>2009-03-16 04:36:38 +0100
committerLen Brown <len.brown@intel.com>2009-04-03 18:05:14 +0200
commit53af9cfb37af5e03ee2b24c5d5c4963c34e5b765 (patch)
tree337290e66795f10e785209e8891d4f4292ce5a89 /drivers/acpi/processor_throttling.c
parentACPI: suspend: Add the Pansonic CF51 box to the dmi check table (diff)
downloadlinux-53af9cfb37af5e03ee2b24c5d5c4963c34e5b765.tar.xz
linux-53af9cfb37af5e03ee2b24c5d5c4963c34e5b765.zip
ACPI: get_throttling_state() cannot be larger than state_count
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>
Diffstat (limited to 'drivers/acpi/processor_throttling.c')
-rw-r--r--drivers/acpi/processor_throttling.c6
1 files changed, 2 insertions, 4 deletions
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,