summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsashwinbalaji <sashwinbalaji@google.com>2023-05-29 16:04:16 +0800
committersashwinbalaji <sashwinbalaji@google.com>2023-05-29 16:04:16 +0800
commit8181c1d89089688083f3f9db4f7a4b43cbcdb870 (patch)
tree330ad0aba2f3c372428e1d70ac7558a96cdceb50
parentc91afc8b03cfcabc423c8e60ac2bcb452462f5bf (diff)
downloadpixel-8181c1d89089688083f3f9db4f7a4b43cbcdb870.tar.gz
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
-rw-r--r--thermal/utils/thermal_stats_helper.cpp2
1 files changed, 1 insertions, 1 deletions
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<ISta
std::vector<int64_t> time_in_state_ms = processStatsRecordForReporting(stats_record);
const auto since_last_update_ms = std::chrono::duration_cast<std::chrono::milliseconds>(
stats_record->cur_state_start_time - stats_record->last_stats_report_time);
- values[3].set<VendorAtomValue::longValue>(since_last_update_ms.count());
+ values[2].set<VendorAtomValue::longValue>(since_last_update_ms.count());
VendorAtomValue tmp;
for (auto &time_in_state : time_in_state_ms) {
tmp.set<VendorAtomValue::longValue>(time_in_state);