Skip to content

Commit 2713b83

Browse files
committed
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: 058f5e4 ("ACPI: thermal: Drop valid flag from struct acpi_thermal_trip") Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 3e7d6f3 commit 2713b83

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/acpi/thermal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,9 @@ static int acpi_thermal_get_trip_points(struct acpi_thermal *tz)
480480

481481
}
482482

483+
while (++i < ACPI_THERMAL_MAX_ACTIVE)
484+
tz->trips.active[i].trip.temperature = THERMAL_TEMP_INVALID;
485+
483486
return count;
484487
}
485488

0 commit comments

Comments
 (0)