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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 8 Oct 2017 08:26:04 +0000 (10:26 +0200)
commit772384d7ec40c6a32d04b30143796a51944f56fd
tree54618ddcd23a05ab3d4e933ad28be5f95f708d01
parentd74f860528fbd0cde7127b617d7695bbc68d8e0f
hwmon: (gl520sm) Fix overflows and crash seen when writing into limit attributes

[ Upstream commit 87cdfa9d60f4f40e6d71b04b10b36d9df3c89282 ]

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>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/gl520sm.c