]> git.karo-electronics.de Git - linux-beck.git/commit
hwmon: (adt7470) Fix overflows seen when writing into limit attributes
authorGuenter Roeck <linux@roeck-us.net>
Sat, 3 Dec 2016 19:10:34 +0000 (11:10 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 10 Dec 2016 05:54:32 +0000 (21:54 -0800)
commit64bd708ae0edced5eee764c2321b280bc1e16550
tree4b07a781cd168dd86fa3e5905ed5a605e2262c5c
parentb94793b4da1011f24321e2ecc5e173a7198358a5
hwmon: (adt7470) Fix overflows seen when writing into limit attributes

Fix overflows seen when writing large values into various temperature limit
attributes.

The input value passed to DIV_ROUND_CLOSEST() needs to be clamped to avoid
such overflows.

Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/adt7470.c