diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2024-07-18 19:52:01 +0300 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2024-07-31 20:43:52 +0300 |
| commit | 744ec4477b11c42e2c8de9eb8364675ae7a0bd81 (patch) | |
| tree | 5fc9ddf1626a0def4c9e28eea37832ecabaaa996 /include/linux | |
| parent | 97adb1aacef8f3f3ec3363ac1f8b72db432f55f0 (diff) | |
| download | linux-744ec4477b11c42e2c8de9eb8364675ae7a0bd81.tar.xz | |
hwmon: (max16065) Fix overflows seen when writing limits
Writing large limits resulted in overflows as reported by module tests.
in0_lcrit: Suspected overflow: [max=5538, read 0, written 2147483647]
in0_crit: Suspected overflow: [max=5538, read 0, written 2147483647]
in0_min: Suspected overflow: [max=5538, read 0, written 2147483647]
Fix the problem by clamping prior to multiplications and the use of
DIV_ROUND_CLOSEST, and by using consistent variable types.
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Fixes: f5bae2642e3d ("hwmon: Driver for MAX16065 System Manager and compatibles")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
