summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorIkjoon Jang <ikjn@chromium.org>2020-01-11 01:47:12 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2020-01-13 11:14:58 +0100
commit57388a2ccb6c2f554fee39772886c69b796dde53 (patch)
treeb18506194662425d4014238af2525c9c3338e779 /drivers
parentb3a987b0264d3ddbb24293ebff10eddfc472f653 (diff)
cpuidle: teo: Fix intervals[] array indexing bug
Fix a simple bug in rotating array index. Fixes: b26bf6ab716f ("cpuidle: New timer events oriented governor for tickless systems") Signed-off-by: Ikjoon Jang <ikjn@chromium.org> Cc: 5.1+ <stable@vger.kernel.org> # 5.1+ Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/cpuidle/governors/teo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c
index de7e706efd46..6deaaf5f05b5 100644
--- a/drivers/cpuidle/governors/teo.c
+++ b/drivers/cpuidle/governors/teo.c
@@ -198,7 +198,7 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
* pattern detection.
*/
cpu_data->intervals[cpu_data->interval_idx++] = measured_ns;
- if (cpu_data->interval_idx > INTERVALS)
+ if (cpu_data->interval_idx >= INTERVALS)
cpu_data->interval_idx = 0;
}