Skip to content

Commit 202aa0d

Browse files
committed
thermal: core: Do not call handle_thermal_trip() if zone temperature is invalid
Make __thermal_zone_device_update() bail out if update_temperature() fails to update the zone temperature because __thermal_zone_get_temp() has returned an error and the current zone temperature is THERMAL_TEMP_INVALID (user space receiving netlink thermal messages, thermal debug code and thermal governors may get confused otherwise). Fixes: 9ad1804 ("thermal: core: Send trip crossing notifications at init time if needed") Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Lukasz Luba <[email protected]> Tested-by: Lukasz Luba <[email protected]>
1 parent 1502718 commit 202aa0d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/thermal/thermal_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,9 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,
487487

488488
update_temperature(tz);
489489

490+
if (tz->temperature == THERMAL_TEMP_INVALID)
491+
return;
492+
490493
__thermal_zone_set_trips(tz);
491494

492495
tz->notify_event = event;

0 commit comments

Comments
 (0)