intel / thermal_daemon

Thermal daemon for IA
GNU General Public License v2.0
539 stars 117 forks source link

src/thd_cdev_rapl.cpp: cthd_sysfs_cdev_rapl::update() - domain_name usage when not being assigned. #406

Closed ColinIanKing closed 1 year ago

ColinIanKing commented 1 year ago

In cthd_sysfs_cdev_rapl::update() string domain_name is declared at the start of the function:

int cthd_sysfs_cdev_rapl::update() { 
        int constraint_phy_max; 
        bool ppcc = false;
        std::string domain_name;     

..and later on it is being referenced:

                // Check if there is any sane max power limit set
                if (phy_max < 0 || phy_max > rapl_max_sane_phy_max) {
                        thd_log_info("%s:powercap RAPL invalid max power limit range \n",
                                        domain_name.c_str());

..but I don't see anywhere between these two points in the code where domain_name is being set to anything. Should it be read using cdev_sysfs.read("name", domain_name) somewhere?

spandruvada commented 1 year ago

Fixed. Thanks for reporting.