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:14:17 +0000 (10:14 +0200)
commit297b8b01ec278ceadf55cc7f243797700a250a1c
treebb1854261c0f1d009199b2f0951cd94b577c6586
parentd89f41c20f32cd276e716569b60a5eac0ac64ad9
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