[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200110015917.32825-1-ikjn@chromium.org>
Date: Fri, 10 Jan 2020 09:59:17 +0800
From: Ikjoon Jang <ikjn@...omium.org>
To: linux-pm@...r.kernel.org,
"RafaelJ . Wysocki" <rafael.j.wysocki@...el.com>
Cc: DanielLezcano <daniel.lezcano@...aro.org>,
linux-kernel@...r.kernel.org, Ikjoon Jang <ikjn@...omium.org>
Subject: [PATCH] BUG-REPORT: cpuidle: teo: intervals[] array index out
This seems to be a simple bug in rotating array index.
---
drivers/cpuidle/governors/teo.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
}
--
2.24.1.735.g03f4e72817-goog
Powered by blists - more mailing lists