mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
cpuidle: teo: Fix intervals[] array indexing bug
commit57388a2ccbupstream. Fix a simple bug in rotating array index. Fixes:b26bf6ab71("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
af2e7c923d
commit
55b256b4c7
@@ -194,7 +194,7 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
|
||||
* pattern detection.
|
||||
*/
|
||||
cpu_data->intervals[cpu_data->interval_idx++] = measured_us;
|
||||
if (cpu_data->interval_idx > INTERVALS)
|
||||
if (cpu_data->interval_idx >= INTERVALS)
|
||||
cpu_data->interval_idx = 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user