diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2024-07-01 14:13:44 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2024-07-01 14:13:44 +0000 |
commit | 8b90154fb59eac9250acd023f91537fa1542c6f8 (patch) | |
tree | 908ac5177cda92134090d7ee3b47ff37f793ff56 /sys/dev | |
parent | ed40669e26c5a05d1afa2e38ed43fd68f5cf7af3 (diff) |
Don't crash if we can't read the temperature for a zone while polling it.
ok dv@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ofw/ofw_thermal.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ofw/ofw_thermal.c b/sys/dev/ofw/ofw_thermal.c index 3e7ab68136d..b895281f9ef 100644 --- a/sys/dev/ofw/ofw_thermal.c +++ b/sys/dev/ofw/ofw_thermal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_thermal.c,v 1.9 2024/06/27 09:37:07 kettenis Exp $ */ +/* $OpenBSD: ofw_thermal.c,v 1.10 2024/07/01 14:13:43 kettenis Exp $ */ /* * Copyright (c) 2019 Mark Kettenis * @@ -306,12 +306,12 @@ thermal_zone_poll(void *arg) int32_t temp, delta; int i; + tp = tz->tz_trips; temp = thermal_get_temperature_cells(tz->tz_sensors); if (temp == THERMAL_SENSOR_MAX) goto out; newtp = NULL; - tp = tz->tz_trips; for (i = 0; i < tz->tz_ntrips; i++) { if (temp < tp->tp_temperature && tp != tz->tz_tp) break; @@ -372,7 +372,7 @@ out: if (polling_delay > 0) timeout_add_msec(&tz->tz_poll_to, polling_delay); - else + else if (tp) thermal_set_limit_cells(tz->tz_sensors, tp->tp_temperature); } |