Commit 57388a2c authored by Ikjoon Jang's avatar Ikjoon Jang Committed by Rafael J. Wysocki

cpuidle: teo: Fix intervals[] array indexing bug

Fix a simple bug in rotating array index.

Fixes: b26bf6ab ("cpuidle: New timer events oriented governor for tickless systems")
Signed-off-by: default avatarIkjoon Jang <ikjn@chromium.org>
Cc: 5.1+ <stable@vger.kernel.org> # 5.1+
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent b3a987b0
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment