[PATCH 12/31] hwmon: (pmbus/fsp-3y) use 4-argument i2c_smbus_read_block_data()

From: Dmitry Torokhov

Date: Sat Oct 24 2026 - 23:09:48 EST


Pass sizeof(buf) - 1 to i2c_smbus_read_block_data() in fsp3y_detect()
to leave room for the NUL terminator.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/hwmon/pmbus/fsp-3y.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/hwmon/pmbus/fsp-3y.c b/drivers/hwmon/pmbus/fsp-3y.c
index 44cf2db9364b..c59a58001c48 100644
--- a/drivers/hwmon/pmbus/fsp-3y.c
+++ b/drivers/hwmon/pmbus/fsp-3y.c
@@ -205,7 +205,8 @@ static int fsp3y_detect(struct i2c_client *client)
int rv;
u8 buf[I2C_SMBUS_BLOCK_MAX + 1];

- rv = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, buf);
+ rv = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL,
+ sizeof(buf) - 1, buf);
if (rv < 0)
return rv;


--
2.56.0.257.gf7497c7d27-goog