From: Srinivas Pandruvada Date: Wed, 12 Nov 2014 23:43:29 +0000 (-0800) Subject: thermal: core: ignore invalid trip temperature X-Git-Tag: v3.19-rc1~46^2~4 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=84ffe3ecc2c8b3effc41c0babd2cc24f1edb2aab;p=karo-tx-linux.git thermal: core: ignore invalid trip temperature Ignore invalid trip temperature less or equal to zero. Some buggy systems have invalid trips, causing system shutdown. Signed-off-by: Srinivas Pandruvada Signed-off-by: Zhang Rui --- diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index 43b90709585f..5aa57736fa9e 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -368,7 +368,7 @@ static void handle_critical_trips(struct thermal_zone_device *tz, tz->ops->get_trip_temp(tz, trip, &trip_temp); /* If we have not crossed the trip_temp, we do not care. */ - if (tz->temperature < trip_temp) + if (trip_temp <= 0 || tz->temperature < trip_temp) return; trace_thermal_zone_trip(tz, trip, trip_type);