diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-07-29 22:23:12 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-09-05 16:28:35 -0700 |
commit | 53f281f2b4288f7b5ebfff3d76629e96bdd07f28 (patch) | |
tree | feb6bed74592ec0881e10cbe26ab4644b64a72dc /drivers/hwmon/via-cputemp.c | |
parent | 06f770aa658cef847c8022bdff436885bde3f7bf (diff) | |
download | lwn-53f281f2b4288f7b5ebfff3d76629e96bdd07f28.tar.gz lwn-53f281f2b4288f7b5ebfff3d76629e96bdd07f28.zip |
hwmon: (lm85) Fix various errors on attribute writes
commit 3248c3b771ddd9d31695da17ba350eb6e1b80a53 upstream.
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>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hwmon/via-cputemp.c')
0 files changed, 0 insertions, 0 deletions