aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTuukka Tikkanen <tuukka.tikkanen@linaro.org>2015-01-13 19:36:08 +0200
committerTuukka Tikkanen <tuukka.tikkanen@linaro.org>2015-01-13 19:36:08 +0200
commitb67b73da9fa327f25a7855a2773afa74e8870255 (patch)
treeed0ea835c3a26b2841549bde697e20f0dbd8772f
parent11e7cd17f1744922412c82210744b67289b74e9f (diff)
Topology: Fix loop bound
The c-state information copy loop in create_states() should iterate from 0 to MAXCSTATE-1 instead of 0 to MAXCSTATE. This patch replaces the upper bound comparison operator <= with < to fix this. Reported-by: Coverity Scan <scan-admin@coverity.com> Signed-off-by: Tuukka Tikkanen <tuukka.tikkanen@linaro.org>
-rw-r--r--topology.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/topology.c b/topology.c
index 699e467..c43536d 100644
--- a/topology.c
+++ b/topology.c
@@ -693,7 +693,7 @@ static struct cpuidle_cstates *create_states(struct cpuidle_cstate *s_state)
/* Copy state information */
d_state = result->cstate;
- for (i = 0; i <= MAXCSTATE; ++d_state, ++s_state, ++i) {
+ for (i = 0; i < MAXCSTATE; ++d_state, ++s_state, ++i) {
if (s_state->name == NULL)
continue;