Skip to content

Commit ccf70c4

Browse files
Sanman Pradhangroeck
authored andcommitted
hwmon: (pxe1610) Check return value of page-select write in probe
pxe1610_probe() writes PMBUS_PAGE to select page 0 but does not check the return value. If the write fails, subsequent register reads operate on an indeterminate page, leading to silent misconfiguration. Check the return value and propagate the error using dev_err_probe(), which also handles -EPROBE_DEFER correctly without log spam. Fixes: 344757b ("hwmon: (pmbus) Add Infineon PXE1610 VR driver") Signed-off-by: Sanman Pradhan <psanman@juniper.net> Link: https://lore.kernel.org/r/20260329170925.34581-4-sanman.pradhan@hpe.com [groeck: Fix "Fixes" SHA] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 0e211f6 commit ccf70c4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

drivers/hwmon/pmbus/pxe1610.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ static int pxe1610_probe(struct i2c_client *client)
104104
* By default this device doesn't boot to page 0, so set page 0
105105
* to access all pmbus registers.
106106
*/
107-
i2c_smbus_write_byte_data(client, PMBUS_PAGE, 0);
107+
ret = i2c_smbus_write_byte_data(client, PMBUS_PAGE, 0);
108+
if (ret < 0)
109+
return dev_err_probe(&client->dev, ret,
110+
"Failed to set page 0\n");
108111

109112
/* Read Manufacturer id */
110113
ret = i2c_smbus_read_block_data(client, PMBUS_MFR_ID, buf);

0 commit comments

Comments
 (0)