hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes
authorGuenter Roeck <linux@roeck-us.net>
Tue, 27 Dec 2016 22:15:07 +0000 (14:15 -0800)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 10 Jan 2017 16:59:35 +0000 (08:59 -0800)
commit87cdfa9d60f4f40e6d71b04b10b36d9df3c89282
treed1dabc0954c4c68cbd1d7736ee46558fa16947a5
parentf80e868cb92aa68b775c1aee434b440475f62d61
hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes

Writes into limit attributes can overflow due to multplications and
additions with unbound input values. Writing into fan limit attributes
can result in a crash with a division by zero if very large values are
written and the fan divider is larger than 1.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/gl520sm.c