[PATCH 11/31] hwmon: (pmbus/dps920ab) use 4-argument i2c_smbus_read_block_data()
From: Dmitry Torokhov
Date: Sat Oct 24 2026 - 23:07:24 EST
Pass sizeof(buf) - 1 to i2c_smbus_read_block_data() in dps920ab_probe()
to leave space for the NUL terminator.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/hwmon/pmbus/dps920ab.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/pmbus/dps920ab.c b/drivers/hwmon/pmbus/dps920ab.c
index 0d2901c314c2..694b5f386df5 100644
--- a/drivers/hwmon/pmbus/dps920ab.c
+++ b/drivers/hwmon/pmbus/dps920ab.c
@@ -143,7 +143,8 @@ static int dps920ab_probe(struct i2c_client *client)
if (!data)
return -ENOMEM;
- ret = i2c_smbus_read_block_data(client, PMBUS_MFR_ID, buf);
+ ret = i2c_smbus_read_block_data(client, PMBUS_MFR_ID,
+ sizeof(buf) - 1, buf);
if (ret < 0) {
dev_err(&client->dev, "Failed to read Manufacturer ID\n");
return ret;
@@ -159,7 +160,8 @@ static int dps920ab_probe(struct i2c_client *client)
if (!data->mfr_id)
return -ENOMEM;
- 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(&client->dev, "Failed to read Manufacturer Model\n");
return ret;
--
2.56.0.257.gf7497c7d27-goog