summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorCyril Raju <craju@nvidia.com>2016-07-21 13:14:39 -0400
committerNicolin Chen <nicolinc@nvidia.com>2017-08-14 21:38:53 -0400
commit26ed213914b06edcaf27eba29eea460986d8774f (patch)
treeaeb5e46dcc7993d508fb03547e6745650b9427d6 /drivers/misc
parent2ace707f2c765da4926101cbeb42df9a5201c28b (diff)
therm_est: skin sensor registration failure
NULL checks in therm_est_get_trend during thermal_zone_of_sensor_register registration of the skin virtual sensor. Bug 1790948 Change-Id: I3c3a793b32e41ada5f4420829321ce0afc6d838b Signed-off-by: Cyril Raju <craju@nvidia.com> Reviewed-on: http://git-master/r/1185044
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/therm_est.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/misc/therm_est.c b/drivers/misc/therm_est.c
index c192297d6..ed445d205 100644
--- a/drivers/misc/therm_est.c
+++ b/drivers/misc/therm_est.c
@@ -176,7 +176,9 @@ static int therm_est_get_trend(void *of_data, long *trend)
176{ 176{
177 struct therm_estimator *est = (struct therm_estimator *)of_data; 177 struct therm_estimator *est = (struct therm_estimator *)of_data;
178 178
179 if (est->thz->temperature > est->thz->last_temperature + 100) 179 if (IS_ERR_OR_NULL(est->thz))
180 *trend = THERMAL_TREND_STABLE;
181 else if (est->thz->temperature > est->thz->last_temperature + 100)
180 *trend = THERMAL_TREND_RAISING; 182 *trend = THERMAL_TREND_RAISING;
181 else if (est->thz->temperature < est->thz->last_temperature - 100) 183 else if (est->thz->temperature < est->thz->last_temperature - 100)
182 *trend = THERMAL_TREND_DROPPING; 184 *trend = THERMAL_TREND_DROPPING;