~ubuntu-branches/ubuntu/utopic/thermald/utopic

« back to all changes in this revision

Viewing changes to debian/patches/0029-coverity-scans-Uninitialized-scalar-field-errors.patch

  • Committer: Package Import Robot
  • Author(s): Colin King
  • Date: 2014-05-19 12:41:22 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20140519124122-zan11arvjxtbqcq5
Tags: 1.2-1
* Adjust for coretemp path change
* Deny non root users to send system bus dbus messages
* Remove compile warning
* Remove rpmlint warning for manual page
* Remove old patches that are now included into version 1.2
* Sync up with version 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From 50939165193f063f9bcbbb15024b1a21bc56e20c Mon Sep 17 00:00:00 2001
2
 
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
3
 
Date: Tue, 11 Mar 2014 15:49:57 -0700
4
 
Subject: [PATCH 29/33] coverity scans: Uninitialized scalar field errors
5
 
 
6
 
Addressed uninitialized scalar field errors.
7
 
---
8
 
 src/thd_engine.cpp    |  1 +
9
 
 src/thd_kobj_uevent.h |  8 +++++++-
10
 
 src/thd_model.cpp     | 14 ++++++--------
11
 
 3 files changed, 14 insertions(+), 9 deletions(-)
12
 
 
13
 
diff --git a/src/thd_engine.cpp b/src/thd_engine.cpp
14
 
index 0db9138..63701ea 100644
15
 
--- a/src/thd_engine.cpp
16
 
+++ b/src/thd_engine.cpp
17
 
@@ -53,6 +53,7 @@ cthd_engine::cthd_engine() :
18
 
        thd_attr = pthread_attr_t();
19
 
        thd_cond_var = pthread_cond_t();
20
 
        thd_cond_mutex = pthread_mutex_t();
21
 
+       memset(poll_fds, 0, sizeof(poll_fds));
22
 
 }
23
 
 
24
 
 cthd_engine::~cthd_engine() {
25
 
diff --git a/src/thd_kobj_uevent.h b/src/thd_kobj_uevent.h
26
 
index e13d263..d30ea5c 100644
27
 
--- a/src/thd_kobj_uevent.h
28
 
+++ b/src/thd_kobj_uevent.h
29
 
@@ -45,10 +45,16 @@ private:
30
 
        char device_path[max_buffer_size];
31
 
 
32
 
 public:
33
 
+       cthd_kobj_uevent() {
34
 
+               fd = 0;
35
 
+               memset(&nls, 0, sizeof(nls));
36
 
+               device_path[0] = '\0';
37
 
+       }
38
 
        int kobj_uevent_open();
39
 
        void kobj_uevent_close();
40
 
        void register_dev_path(char *path);
41
 
        bool check_for_event();
42
 
-};
43
 
+}
44
 
+;
45
 
 
46
 
 #endif
47
 
diff --git a/src/thd_model.cpp b/src/thd_model.cpp
48
 
index 8820386..cbce043 100644
49
 
--- a/src/thd_model.cpp
50
 
+++ b/src/thd_model.cpp
51
 
@@ -45,14 +45,12 @@ cthd_model::cthd_model(std::string _zone_type, bool use_pid) :
52
 
                                0), set_point_reached(false), delay_cnt(0), max_temp_seen(
53
 
                                false), updated_set_point(false), use_pid_param(use_pid), set_point_delay_start(
54
 
                                0), user_forced_set_point_change(false) {
55
 
-       if (use_pid) {
56
 
-               // set default pid parameters
57
 
-               kp = 0.5;
58
 
-               ki = kd = 0.0001;
59
 
-               last_time = 0;
60
 
-               err_sum = 0.0;
61
 
-               last_err = 0.0;
62
 
-       }
63
 
+       // set default pid parameters
64
 
+       kp = 0.5;
65
 
+       ki = kd = 0.0001;
66
 
+       last_time = 0;
67
 
+       err_sum = 0.0;
68
 
+       last_err = 0.0;
69
 
 }
70
 
 
71
 
 unsigned int cthd_model::update_set_point(unsigned int curr_temp) {
72
 
1.9.0
73