Re: [PATCH] hwmon: (nct6775-core) Fix overflows seen when writing limit attributes

From: Guenter Roeck
Date: Mon Nov 11 2024 - 21:28:49 EST


On Tue, Nov 12, 2024 at 09:39:51AM +0800, Pei Xiao wrote:
> DIV_ROUND_CLOSEST() after kstrtoul() results in an overflow if a large
> number such as 18446744073709551615 is provided by the user.
> Fix it by reordering clamp_val() and DIV_ROUND_CLOSEST() operations.
>
> Signed-off-by: Pei Xiao <xiaopei01@xxxxxxxxxx>
> Fixes: c3963bc0a0cf ("hwmon: (nct6775) Split core and platform driver")

Applied.

Thanks,
Guenter