Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fb2b9ac authored by Dan Carpenter's avatar Dan Carpenter Committed by Eduardo Valentin
Browse files

thermal: underflow bug in imx_set_trip_temp()



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

Fixes: 17e8351a ('thermal: consistently use int for temperatures')
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarEduardo Valentin <edubezval@gmail.com>
parent b56100db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;