summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSanman Pradhan <psanman@juniper.net>2026-03-17 17:37:41 +0000
committerGuenter Roeck <linux@roeck-us.net>2026-03-17 15:20:55 -0700
commitc6f45ed26b6eb4766db06f21ff28a97ed485bcbb (patch)
tree29838962863d4abde464812cb00e40b3e5b85c83 /kernel
parent19d4b9c8a136704d5f2544e7ac550f27918a5004 (diff)
hwmon: (pmbus/mp2869) Check pmbus_read_byte_data() before using its return value
In mp2869_read_byte_data() and mp2869_read_word_data(), the return value of pmbus_read_byte_data() for PMBUS_STATUS_MFR_SPECIFIC is used directly inside FIELD_GET() macro arguments without error checking. If the I2C transaction fails, a negative error code is passed to FIELD_GET() and FIELD_PREP(), silently corrupting the status register bits being constructed. Extract the nested pmbus_read_byte_data() calls into a separate variable and check for errors before use. This also eliminates a redundant duplicate read of the same register in the PMBUS_STATUS_TEMPERATURE case. Fixes: a3a2923aaf7f2 ("hwmon: add MP2869,MP29608,MP29612 and MP29816 series driver") Cc: stable@vger.kernel.org Signed-off-by: Sanman Pradhan <psanman@juniper.net> Link: https://lore.kernel.org/r/20260317173308.382545-4-sanman.pradhan@hpe.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions