Skip to content

Commit fb2c102

Browse files
committed
thermal: core: Fix disabled trip point check in handle_thermal_trip()
Commit bc840ea ("thermal: core: Do not handle trip points with invalid temperature") added a check for invalid temperature to the disabled trip point check in handle_thermal_trip(), but that check was added at a point when the trip structure has not been initialized yet. This may cause handle_thermal_trip() to skip a valid trip point in some cases, so fix it by moving the check to a suitable place, after __thermal_zone_get_trip() has been called to populate the trip structure. Fixes: bc840ea ("thermal: core: Do not handle trip points with invalid temperature") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent ebc7abb commit fb2c102

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/thermal/thermal_core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,12 +348,14 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip_id)
348348
struct thermal_trip trip;
349349

350350
/* Ignore disabled trip points */
351-
if (test_bit(trip_id, &tz->trips_disabled) ||
352-
trip.temperature == THERMAL_TEMP_INVALID)
351+
if (test_bit(trip_id, &tz->trips_disabled))
353352
return;
354353

355354
__thermal_zone_get_trip(tz, trip_id, &trip);
356355

356+
if (trip.temperature == THERMAL_TEMP_INVALID)
357+
return;
358+
357359
if (tz->last_temperature != THERMAL_TEMP_INVALID) {
358360
if (tz->last_temperature < trip.temperature &&
359361
tz->temperature >= trip.temperature)

0 commit comments

Comments
 (0)