]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
hwmon: (jc42) Fix integer overflow when writing hysteresis value
authorGuenter Roeck <linux@roeck-us.net>
Mon, 19 Jan 2015 17:16:53 +0000 (09:16 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Mon, 26 Jan 2015 05:23:59 +0000 (21:23 -0800)
commite2c26f058e31619b548046b84fe2c2116cb5016f
tree889f1f0e0b4c96ca91eb35972d5afa1131022c19
parent3a05633b042fb4aea65b09ce2d0d43689df6eb9a
hwmon: (jc42) Fix integer overflow when writing hysteresis value

Subtracting an unsigned long from a signed value causes an overflow with large
values. Use clamp_val() to reduce the number range prior to subtracting it
from the temperature limit.

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