intel / thermal_daemon

Thermal daemon for IA
GNU General Public License v2.0
550 stars 118 forks source link

thd_parse.cpp - parse_pid_values potentially not setting values in type pid_control_t pid_params #382

Closed ColinIanKing closed 1 year ago

ColinIanKing commented 1 year ago

The call to parse_pid_values() in cthd_parse::parse_new_trip_cdev (line 181) passes an uninitialised pid_params to the function. It is possible for the parse_pid_values() to be unable to parse the data and we end up with fields Kp, Ki and Kd not being initialized and so we end up with garbage values in these.

Either pid_params should be initialized before calling parse_pid_values with some sane defaults, or the fields should be set in parse_pid_values with sane defaults before the parsing. Either way, this is a corner case that probably needs some fixing.

spandruvada commented 1 year ago

Added some defaults and pushed change.