Skip to content

Commit

Permalink
LibSensors_getCPUTemperatures: ignore tempID while reading labels
Browse files Browse the repository at this point in the history
Sensors can be numbered in a non-contigouos way, but we must still
scan all labels to get a full account of the measured temperatures.
  • Loading branch information
leahneukirchen committed Sep 1, 2024
1 parent 333bc6d commit 8fdd40c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions linux/LibSensors.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,6 @@ void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, uns
/* Feature name IDs start at 1, adjust to start at 0 to match data indices */
tempID--;

if (tempID > existingCPUs)
continue;

const sensors_subfeature* subFeature = sym_sensors_get_subfeature(chip, feature, SENSORS_SUBFEATURE_TEMP_INPUT);
if (!subFeature)
continue;
Expand Down Expand Up @@ -317,6 +314,9 @@ void LibSensors_getCPUTemperatures(CPUData* cpus, unsigned int existingCPUs, uns
continue;
}

if (tempID > existingCPUs)
continue;

/* If already set, e.g. Ryzen reporting platform temperature for each die, use the bigger one */
if (isNaN(data[tempID])) {
data[tempID] = temp;
Expand Down

0 comments on commit 8fdd40c

Please sign in to comment.