7edc25c
From 18d6ca75bbc504aaf9fe862dc1c10c3c65fbe7bd Mon Sep 17 00:00:00 2001
7edc25c
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
7edc25c
Date: Fri, 30 Jun 2017 10:23:48 -0700
7edc25c
Subject: [PATCH] Initialize lowest_valid_index to prevent SEGV
7edc25c
7edc25c
Chris Murphy reported ThermalMonitor crash by signal 11.
7edc25c
Fix this by initializing lowest_valid_index to 0.
7edc25c
---
7edc25c
 tools/thermal_monitor/thermaldinterface.cpp | 1 +
7edc25c
 1 file changed, 1 insertion(+)
7edc25c
7edc25c
diff --git a/tools/thermal_monitor/thermaldinterface.cpp b/tools/thermal_monitor/thermaldinterface.cpp
7edc25c
index eca8d74..e73b7a5 100644
7edc25c
--- a/tools/thermal_monitor/thermaldinterface.cpp
7edc25c
+++ b/tools/thermal_monitor/thermaldinterface.cpp
7edc25c
@@ -453,6 +453,7 @@ int ThermaldInterface::getZoneInformation(uint index, zoneInformationType &info)
7edc25c
         info.name = result.arguments().at(0).toString();
7edc25c
         info.sensor_count = result.arguments().at(1).toInt();
7edc25c
         info.trip_count = result.arguments().at(2).toInt();
7edc25c
+        info.lowest_valid_index = 0;
7edc25c
         return 0;
7edc25c
     } else {
7edc25c
         qCritical() << "error from" << iface->interface() <<  result.errorMessage();