diff options
author | Guenter Roeck <linux@roeck-us.net> | 2024-07-24 09:42:16 -0700 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2024-08-30 08:34:23 -0700 |
commit | ab7fbee452beca56b7c570d49190e679863362d5 (patch) | |
tree | 2655feac450eab071f410464a3e1c913229908a6 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | bb25cdc2bff408ee3be1f20bd2cee4ea8b79c2d6 (diff) |
hwmon: (ina2xx) Fix various overflow issues
Module tests show various overflow problems when writing limits
and other attributes.
in0_crit: Suspected overflow: [max=82, read 0, written 2147483648]
in0_lcrit: Suspected overflow: [max=82, read 0, written 2147483648]
in1_crit: Suspected overflow: [max=40959, read 0, written 2147483647]
in1_lcrit: Suspected overflow: [max=40959, read 0, written 2147483647]
power1_crit: Suspected overflow: [max=134218750, read 0, written 2147483648]
update_interval: Suspected overflow: [max=2253, read 2, written 2147483647]
Implement missing clamping on attribute write operations to avoid those
problems.
While at it, check in the probe function if the shunt resistor value
passed from devicetree is valid, and bail out if it isn't. Also limit
mutex use to the code calling ina2xx_set_shunt() since it isn't needed
when called from the probe function.
Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions