diff options
| author | Sanman Pradhan <psanman@juniper.net> | 2026-03-17 17:46:31 +0000 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-03-17 15:21:36 -0700 |
| commit | 32f59301b9898c0ab5e72908556d553e2d481945 (patch) | |
| tree | a7bfc1bb6a3fd2e572a8580ab943da48d99fea4c /kernel | |
| parent | c6f45ed26b6eb4766db06f21ff28a97ed485bcbb (diff) | |
hwmon: (pmbus/ina233) Add error check for pmbus_read_word_data() return value
ina233_read_word_data() uses the return value of pmbus_read_word_data()
directly in a DIV_ROUND_CLOSEST() computation without first checking for
errors. If the underlying I2C transaction fails, a negative error code is
used in the arithmetic, producing a garbage sensor value instead of
propagating the error.
Add the missing error check before using the return value.
Fixes: b64b6cb163f16 ("hwmon: Add driver for TI INA233 Current and Power Monitor")
Cc: stable@vger.kernel.org
Signed-off-by: Sanman Pradhan <psanman@juniper.net>
Link: https://lore.kernel.org/r/20260317174553.385567-1-sanman.pradhan@hpe.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions
