Skip to content

Commit

Permalink
thermal: underflow bug in imx_set_trip_temp()
Browse files Browse the repository at this point in the history
We recently changed this from unsigned long to int so it introduced an
underflow bug.

Fixes: 17e8351 ('thermal: consistently use int for temperatures')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eduardo Valentin <edubezval@gmail.com>
  • Loading branch information
Dan Carpenter authored and Eduardo Valentin committed Oct 30, 2015
1 parent b56100d commit 8fb2b9a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/thermal/imx_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 8fb2b9a

Please sign in to comment.