aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-08-21 04:49:09 -0400
committerEduardo Valentin <edubezval@gmail.com>2015-10-30 14:35:50 -0400
commit8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943 (patch)
treeb5baa7bba0813f7643b3e21e8ad6f5b16f9283fd
parentb56100db5b057fef889a73cb66c24633696d188b (diff)
thermal: underflow bug in imx_set_trip_temp()
We recently changed this from unsigned long to int so it introduced an underflow bug. Fixes: 17e8351a7739 ('thermal: consistently use int for temperatures') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
-rw-r--r--drivers/thermal/imx_thermal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/imx_thermal.c b/drivers/thermal/imx_thermal.c
index acd1c7868735..c8fe3cac2e0e 100644
--- a/drivers/thermal/imx_thermal.c
+++ b/drivers/thermal/imx_thermal.c
@@ -288,7 +288,7 @@ static int imx_set_trip_temp(struct thermal_zone_device *tz, int trip,
288 if (trip == IMX_TRIP_CRITICAL) 288 if (trip == IMX_TRIP_CRITICAL)
289 return -EPERM; 289 return -EPERM;
290 290
291 if (temp > IMX_TEMP_PASSIVE) 291 if (temp < 0 || temp > IMX_TEMP_PASSIVE)
292 return -EINVAL; 292 return -EINVAL;
293 293
294 data->temp_passive = temp; 294 data->temp_passive = temp;