summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-01-16 15:55:30 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2020-01-16 15:55:30 -0800
commitf4353c3e2aaf7f7d3c5a18271b368bf5292854c3 (patch)
treec88b560a85103812641e36097e1d32164f0e3e48 /drivers
parent0c99ee44b8921b872089a7374c733310d995fd92 (diff)
parent57388a2ccb6c2f554fee39772886c69b796dde53 (diff)
Merge tag 'pm-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fix from Rafael Wysocki: "Fix a coding mistake in the teo cpuidle governor causing data to be written beyond the last array element (Ikjoon Jang)" * tag 'pm-5.5-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: cpuidle: teo: Fix intervals[] array indexing bug
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;
}