Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Ikjoon Jang and committed by
Rafael J. Wysocki
57388a2c b3a987b0

+1 -1
+1 -1
drivers/cpuidle/governors/teo.c
··· 198 198 * pattern detection. 199 199 */ 200 200 cpu_data->intervals[cpu_data->interval_idx++] = measured_ns; 201 - if (cpu_data->interval_idx > INTERVALS) 201 + if (cpu_data->interval_idx >= INTERVALS) 202 202 cpu_data->interval_idx = 0; 203 203 } 204 204