aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLen Brown <lenb@kernel.org>2009-03-15 23:36:38 -0400
committerLen Brown <len.brown@intel.com>2009-04-03 12:05:14 -0400
commit53af9cfb37af5e03ee2b24c5d5c4963c34e5b765 (patch)
tree337290e66795f10e785209e8891d4f4292ce5a89
parent2a9ef8e1a856be8e526bb9b10fb98c5012f6e3f8 (diff)
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>
-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,
783 (struct acpi_processor_tx_tss *)&(pr->throttling. 783 (struct acpi_processor_tx_tss *)&(pr->throttling.
784 states_tss[i]); 784 states_tss[i]);
785 if (tx->control == value) 785 if (tx->control == value)
786 break; 786 return i;
787 } 787 }
788 if (i > pr->throttling.state_count) 788 return -1;
789 i = -1;
790 return i;
791} 789}
792 790
793static int acpi_get_throttling_value(struct acpi_processor *pr, 791static int acpi_get_throttling_value(struct acpi_processor *pr,