[PATCH 04/31] hwmon: (kb9002) use 4-argument i2c_smbus_read_block_data()
From: Dmitry Torokhov
Date: Sat Oct 24 2026 - 23:07:36 EST
Pass the size of the receive buffer to i2c_smbus_read_block_data() in
kb9002_fw_read() and kb9002_smbus_hw_read().
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
---
drivers/hwmon/kb9002.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/hwmon/kb9002.c b/drivers/hwmon/kb9002.c
index 9f4521630f3a..01dedc00c3f1 100644
--- a/drivers/hwmon/kb9002.c
+++ b/drivers/hwmon/kb9002.c
@@ -183,7 +183,8 @@ static int kb9002_fw_read(struct kb9002_data *data, u16 reg, u32 *val)
if (ret < 0)
return ret;
- ret = i2c_smbus_read_block_data(client, KB9002_CC_FW_READ_DATA, rbuf);
+ ret = i2c_smbus_read_block_data(client, KB9002_CC_FW_READ_DATA,
+ sizeof(rbuf), rbuf);
if (ret < 0)
return ret;
if (ret < (int)(sizeof(addr) + sizeof(*val)))
@@ -208,7 +209,8 @@ static int kb9002_smbus_hw_read(struct kb9002_data *data, u32 reg, u32 *val)
if (ret < 0)
return ret;
- ret = i2c_smbus_read_block_data(client, KB9002_CC_HW_READ_DATA, rbuf);
+ ret = i2c_smbus_read_block_data(client, KB9002_CC_HW_READ_DATA,
+ sizeof(rbuf), rbuf);
if (ret < 0)
return ret;
if (ret < (int)(sizeof(addr) + sizeof(*val)))
--
2.56.0.257.gf7497c7d27-goog