summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/imx_thermal.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-08-21 11:49:09 +0300
committerEduardo Valentin <edubezval@gmail.com>2015-10-30 11:35:50 -0700
commit8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943 (patch)
treeb5baa7bba0813f7643b3e21e8ad6f5b16f9283fd /drivers/thermal/imx_thermal.c
parentb56100db5b057fef889a73cb66c24633696d188b (diff)
downloadop-kernel-dev-8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943.zip
op-kernel-dev-8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943.tar.gz
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>
Diffstat (limited to 'drivers/thermal/imx_thermal.c')
-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 acd1c78..c8fe3ca 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,
if (trip == IMX_TRIP_CRITICAL)
return -EPERM;
- if (temp > IMX_TEMP_PASSIVE)
+ if (temp < 0 || temp > IMX_TEMP_PASSIVE)
return -EINVAL;
data->temp_passive = temp;
OpenPOWER on IntegriCloud