Guenter Roeck 9c01d650e1 hwmon: (w83627ehf) Fix underflows seen when writing limit attributes
[ Upstream commit 5c1de37969b7bc0abcb20b86e91e70caebbd4f89 ]

DIV_ROUND_CLOSEST() after kstrtol() results in an underflow if a large
negative number such as -9223372036854775808 is provided by the user.
Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 93cf73a7bfdce683bde3a7bb65f270d3bd24497b)
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
2024-10-30 14:08:23 +00:00
..
2024-05-30 09:00:38 +00:00
2017-04-02 07:01:53 -07:00
2017-04-02 07:01:53 -07:00
2017-04-13 06:09:26 -07:00
2017-02-16 06:49:05 -08:00
2016-12-02 13:28:05 -08:00