Blob Blame History Raw
From a8eba71a95b3b8af0540f6a93877e24bc8c47079 Mon Sep 17 00:00:00 2001
From: Colin Ian King <colin.king@canonical.com>
Date: Tue, 7 Mar 2017 11:47:51 +0000
Subject: [PATCH] thd_cdev: ensure _target_value is initialized

This fixes an issue discovered by static analysis with
CoverityScan.

CoverityScan CID#157084 ("Uninitialized scalar value")

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/thd_cdev.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/thd_cdev.cpp b/src/thd_cdev.cpp
index 107c1d5..6ee09ee 100644
--- a/src/thd_cdev.cpp
+++ b/src/thd_cdev.cpp
@@ -202,7 +202,7 @@ int cthd_cdev::thd_cdev_set_state(int set_point, int target_temp,
 		thd_log_debug("zone_trip_limits.size() %lu\n", zone_trip_limits.size());
 		if (zone_trip_limits.size() > 0) {
 			int length = zone_trip_limits.size();
-			int _target_value;
+			int _target_value = TRIP_PT_INVALID_TARGET_STATE;
 			int i;
 
 			// Just remove the current zone requesting to turn off