summaryrefslogtreecommitdiff
path: root/drivers/acpi/thermal.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-09-28 17:45:59 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-09-28 19:06:36 +0200
commit2713b83cb3b0ca78dc16a6968d58bee1342c4bc7 (patch)
treeb3aa40db44ced506f5640699fa726edaa0a1833a /drivers/acpi/thermal.c
parent3e7d6f396d74a3e40c390bb53947938957426097 (diff)
ACPI: thermal: Mark uninitialized active trips as invalid
After removing the valid flag from struct acpi_thermal_trip, the trip temperature value is used in validity checks, so it must be THERMAL_TEMP_INVALID for the active trip entries in struct acpi_thermal_trips that are not going to be used (because the corresponding objects are not present in the ACPI tables, for example). Accordingly, modify acpi_thermal_get_trip_points() to set the temperature value to THERMAL_TEMP_INVALID for trip point entries skipped by it after acpi_thermal_init_trip() has returned 'false' for an active trip. Fixes: 058f5e407deb ("ACPI: thermal: Drop valid flag from struct acpi_thermal_trip") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/thermal.c')
-rw-r--r--drivers/acpi/thermal.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index c303688ead71..0c3160c04d65 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -480,6 +480,9 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
}
+ while (++i < ACPI_THERMAL_MAX_ACTIVE)
+ tz->trips.active[i].trip.temperature = THERMAL_TEMP_INVALID;
+
return count;
}