[PATCH 07/31] hwmon: (pmbus/aps-379) use 4-argument i2c_smbus_read_block_data()
From: Dmitry Torokhov
Date: Sat Oct 24 2026 - 23:07:27 EST
Pass sizeof(buf) - 1 to i2c_smbus_read_block_data() in aps_379_probe()
to account for the NUL terminator.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/hwmon/pmbus/aps-379.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hwmon/pmbus/aps-379.c b/drivers/hwmon/pmbus/aps-379.c
index 3ec0940ae564..a21213c21f7d 100644
--- a/drivers/hwmon/pmbus/aps-379.c
+++ b/drivers/hwmon/pmbus/aps-379.c
@@ -117,7 +117,8 @@ static int aps_379_probe(struct i2c_client *client)
| I2C_FUNC_SMBUS_READ_BLOCK_DATA))
return -ENODEV;
- ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL, buf);
+ ret = i2c_smbus_read_block_data(client, PMBUS_MFR_MODEL,
+ sizeof(buf) - 1, buf);
if (ret < 0) {
dev_err(dev, "Failed to read Manufacturer Model\n");
return ret;
--
2.56.0.257.gf7497c7d27-goog