diff options
| author | Guenter Roeck <[email protected]> | 2024-07-13 21:26:19 +0000 |
|---|---|---|
| committer | Guenter Roeck <[email protected]> | 2024-07-14 18:48:50 +0000 |
| commit | cbf7467828cd4ec7ceac7a8b5b5ddb2f69f07b0e (patch) | |
| tree | ea3f27fe8bc3ff750d7310cbab1af9d7fdc1f058 /drivers/fpga/tests/fpga-region-test.c | |
| parent | hwmon: Remove obsolete adm1021 and max6642 drivers (diff) | |
| download | kernel-cbf7467828cd4ec7ceac7a8b5b5ddb2f69f07b0e.tar.gz kernel-cbf7467828cd4ec7ceac7a8b5b5ddb2f69f07b0e.zip | |
hwmon: (max6697) Fix underflow when writing limit attributes
Using DIV_ROUND_CLOSEST() on an unbound value can result in underflows.
Indeed, module test scripts report:
temp1_max: Suspected underflow: [min=0, read 255000, written -9223372036854775808]
temp1_crit: Suspected underflow: [min=0, read 255000, written -9223372036854775808]
Fix by introducing an extra set of clamping.
Fixes: 5372d2d71c46 ("hwmon: Driver for Maxim MAX6697 and compatibles")
Reviewed-by: Tzung-Bi Shih <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Diffstat (limited to 'drivers/fpga/tests/fpga-region-test.c')
0 files changed, 0 insertions, 0 deletions
