summaryrefslogtreecommitdiff
path: root/drivers/hwmon/aht10.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2021-11-17 09:51:47 -0800
committerGuenter Roeck <linux@roeck-us.net>2021-12-12 16:22:53 -0800
commit55840b9eae5367b5d5b29619dc2fb7e4596dba46 (patch)
tree61bb69db6a6d8c3de293f49eb0c5380727f268c7 /drivers/hwmon/aht10.c
parentfce15c45d3fbd9fc1feaaf3210d8e3f8b33dfd3a (diff)
hwmon: (lm90) Prevent integer overflow/underflow in hysteresis calculations
Commit b50aa49638c7 ("hwmon: (lm90) Prevent integer underflows of temperature calculations") addressed a number of underflow situations when writing temperature limits. However, it missed one situation, seen when an attempt is made to set the hysteresis value to MAX_LONG and the critical temperature limit is negative. Use clamp_val() when setting the hysteresis temperature to ensure that the provided value can never overflow or underflow. Fixes: b50aa49638c7 ("hwmon: (lm90) Prevent integer underflows of temperature calculations") Cc: Dmitry Osipenko <digetx@gmail.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/aht10.c')
0 files changed, 0 insertions, 0 deletions