thermal: core: Do not handle trip points with invalid temperature
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 7 Aug 2023 18:01:24 +0000 (20:01 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 10 Aug 2023 18:57:35 +0000 (20:57 +0200)
Trip points with temperature set to THERMAL_TEMP_INVALID are as good as
disabled, so make handle_thermal_trip() ignore them.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
drivers/thermal/thermal_core.c

index 842f678..b38abe8 100644 (file)
@@ -348,7 +348,8 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip_id)
        struct thermal_trip trip;
 
        /* Ignore disabled trip points */
-       if (test_bit(trip_id, &tz->trips_disabled))
+       if (test_bit(trip_id, &tz->trips_disabled) ||
+           trip.temperature == THERMAL_TEMP_INVALID)
                return;
 
        __thermal_zone_get_trip(tz, trip_id, &trip);