]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (sis5595) Prevent overflow problem when writing large limits
authorAxel Lin <axel.lin@ingics.com>
Thu, 31 Jul 2014 14:27:04 +0000 (22:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Sep 2014 23:34:14 +0000 (16:34 -0700)
commit728d3c854de8f28464e7a3127e21abde735eb796
tree5f7cd6fa65fc45b422f79beee9b43ca1d2a844da
parent0e28d9e39645c427815ebcdd5409187e8db9b10b
hwmon: (sis5595) Prevent overflow problem when writing large limits

commit cc336546ddca8c22de83720632431c16a5f9fe9a upstream.

On platforms with sizeof(int) < sizeof(long), writing a temperature
limit larger than MAXINT will result in unpredictable limit values
written to the chip. Avoid auto-conversion from long to int to fix
the problem.

Signed-off-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>
drivers/hwmon/sis5595.c