From 8fdd40c5bb9cae0fb9aada87c00b7830f7ee2fa4 Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Wed, 26 Jun 2024 17:29:35 +0200 Subject: [PATCH] LibSensors_getCPUTemperatures: ignore tempID while reading labels 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. --- linux/LibSensors.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/linux/LibSensors.c b/linux/LibSensors.c index 6df1a5cd8..cacddd6e6 100644 --- a/linux/LibSensors.c +++ b/linux/LibSensors.c @@ -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; @@ -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;