summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/lm78.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2014-07-29 22:23:12 -0700
committerGuenter Roeck <linux@roeck-us.net>2014-07-30 21:42:33 -0700
commit3248c3b771ddd9d31695da17ba350eb6e1b80a53 (patch)
treee6457d08a935abcf10ea9d4d3be2251f21bde002 /drivers/hwmon/lm78.c
parent56de1377ad92f72ee4e5cb0faf7a9b6048fdf0bf (diff)
downloadlinux-stable-3248c3b771ddd9d31695da17ba350eb6e1b80a53.tar.gz
linux-stable-3248c3b771ddd9d31695da17ba350eb6e1b80a53.tar.bz2
linux-stable-3248c3b771ddd9d31695da17ba350eb6e1b80a53.zip
hwmon: (lm85) Fix various errors on attribute writes
Temperature limit register writes did not account for negative numbers. As a result, writing -127000 resulted in -126000 written into the temperature limit register. This problem affected temp[1-3]_min, temp[1-3]_max, temp[1-3]_auto_temp_crit, and temp[1-3]_auto_temp_min. When writing pwm[1-3]_freq, a long variable was auto-converted into an int without range check. Wiring values larger than MAXINT resulted in unexpected register values. When writing temp[1-3]_auto_temp_max, an unsigned long variable was auto-converted into an int without range check. Writing values larger than MAXINT resulted in unexpected register values. vrm is an u8, so the written value needs to be limited to [0, 255]. Cc: Axel Lin <axel.lin@ingics.com> Cc: stable@vger.kernel.org Reviewed-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/lm78.c')
0 files changed, 0 insertions, 0 deletions