Re: [PATCH 0/5] hwmon: (pmbus) Fix unchecked error returns in multiple drivers
From: Guenter Roeck
Date: Tue Mar 17 2026 - 18:23:16 EST
On Tue, Mar 17, 2026 at 05:36:33PM +0000, Pradhan, Sanman wrote:
> From: Sanman Pradhan <psanman@xxxxxxxxxxx>
>
> Several PMBus device drivers use the return value of pmbus_read_word_data()
> or pmbus_read_byte_data() in arithmetic, bitwise, or macro operations
> without first checking for a negative error code. If the underlying I2C
> transaction fails, the negative errno propagates into FIELD_GET(),
> FIELD_PREP(), XOR, or DIV_ROUND_CLOSEST operations, silently producing
> corrupted sensor or status data instead of reporting the error.
>
AI review feedback is at
https://sashiko.dev/#/patchset/20260317174553.385567-1-sanman.pradhan%40hpe.com
One of the drivers (see patch 4 feedback) has an unrelated problem, for which
I would appreciate a fix, but patch 5/5 is making a wrong functional change
which needs to be fixed.
I'll apply patches 1..4 of the series.
Thanks,
Guenter
> Sanman Pradhan (5):
> hwmon: (pmbus/hac300s) Add error check for pmbus_read_word_data()
> return value
> hwmon: (pmbus/mp2975) Add error check for pmbus_read_word_data()
> return value
> hwmon: (pmbus/mp2869) Check pmbus_read_byte_data() before using its
> return value
> hwmon: (pmbus/ina233) Add error check for pmbus_read_word_data()
> return value
> hwmon: (pmbus/isl68137) Fix unchecked return value and use
> sysfs_emit()
>
> drivers/hwmon/pmbus/hac300s.c | 2 ++
> drivers/hwmon/pmbus/ina233.c | 2 ++
> drivers/hwmon/pmbus/isl68137.c | 7 +++++--
> drivers/hwmon/pmbus/mp2869.c | 35 ++++++++++++++++++++--------------
> drivers/hwmon/pmbus/mp2975.c | 2 ++
> 5 files changed, 32 insertions(+), 16 deletions(-)
>
> --
> 2.34.1
>
>