From 8181c1d89089688083f3f9db4f7a4b43cbcdb870 Mon Sep 17 00:00:00 2001 From: sashwinbalaji Date: Mon, 29 May 2023 16:04:16 +0800 Subject: thermal: metrics: Fix array indexing By mistake accessed index out of bounds fix the index accessed to proper value. Bug: 284789801 Test: Local build and verify no SIGSEGV Change-Id: I993fb9a6878de2538b7fd13cefafbca7042fb4e1 --- thermal/utils/thermal_stats_helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thermal/utils/thermal_stats_helper.cpp b/thermal/utils/thermal_stats_helper.cpp index 34446b98..daaaf1c6 100644 --- a/thermal/utils/thermal_stats_helper.cpp +++ b/thermal/utils/thermal_stats_helper.cpp @@ -409,7 +409,7 @@ bool ThermalStatsHelper::reportSensorCdevRequestStats(const std::shared_ptr time_in_state_ms = processStatsRecordForReporting(stats_record); const auto since_last_update_ms = std::chrono::duration_cast( stats_record->cur_state_start_time - stats_record->last_stats_report_time); - values[3].set(since_last_update_ms.count()); + values[2].set(since_last_update_ms.count()); VendorAtomValue tmp; for (auto &time_in_state : time_in_state_ms) { tmp.set(time_in_state); -- cgit v1.2.3