diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2015-08-21 11:49:09 +0300 |
---|---|---|
committer | Eduardo Valentin <edubezval@gmail.com> | 2015-10-30 11:35:50 -0700 |
commit | 8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943 (patch) | |
tree | b5baa7bba0813f7643b3e21e8ad6f5b16f9283fd /drivers/thermal/imx_thermal.c | |
parent | b56100db5b057fef889a73cb66c24633696d188b (diff) | |
download | linux-8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943.tar.gz linux-8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943.tar.bz2 linux-8fb2b9ac2aadd6d87f89071c2c85f8c12b41c943.zip |
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.c | 2 |
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, 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; |