thermal: underflow bug in imx_set_trip_temp()

We recently changed this from unsigned long to int so it introduced an
underflow bug.

Fixes: 17e8351a77 ('thermal: consistently use int for temperatures')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
This commit is contained in:
Dan Carpenter 2015-08-21 11:49:09 +03:00 коммит произвёл Eduardo Valentin
Родитель b56100db5b
Коммит 8fb2b9ac2a
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;