[PATCH 31/31] hwmon: (pmbus/zl6100) use 4-argument i2c_smbus_read_block_data()
From: Dmitry Torokhov
Date: Sat Oct 24 2026 - 23:13:26 EST
Pass sizeof(device_id) - 1 to i2c_smbus_read_block_data() in
zl6100_probe() to leave space for the NUL terminator.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/hwmon/pmbus/zl6100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/pmbus/zl6100.c b/drivers/hwmon/pmbus/zl6100.c
index 5db2a7818d16..43f59cfc313f 100644
--- a/drivers/hwmon/pmbus/zl6100.c
+++ b/drivers/hwmon/pmbus/zl6100.c
@@ -290,7 +290,7 @@ static int zl6100_probe(struct i2c_client *client)
return -ENODEV;
ret = i2c_smbus_read_block_data(client, ZL6100_DEVICE_ID,
- device_id);
+ sizeof(device_id) - 1, device_id);
if (ret < 0) {
dev_err(&client->dev, "Failed to read device ID\n");
return ret;
--
2.56.0.257.gf7497c7d27-goog