hwmon: (lm90) Prevent integer underflows of temperature calculations
authorDmitry Osipenko <digetx@gmail.com>
Wed, 23 Jun 2021 04:22:30 +0000 (07:22 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 24 Jun 2021 14:14:27 +0000 (07:14 -0700)
commitb50aa49638c7e12abf4ecc483f4e928c5cccc1b0
tree2fa4452247143bf21e425a0937ed54a9e0f90bd1
parent4c7f85a321a1ac265159c22a6998ef4f2a60c21d
hwmon: (lm90) Prevent integer underflows of temperature calculations

The min/max/crit and all other temperature values that are passed to
the driver are unlimited and value that is close to INT_MIN results in
integer underflow of the temperature calculations made by the driver
for LM99 sensor. Temperature hysteresis is among those values that need
to be limited, but limiting of hysteresis is independent from the sensor
version. Add the missing limits.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210623042231.16008-2-digetx@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm90.c