From 0e1d292233c83d41530df6ffa4ec5a382f118b12 Mon Sep 17 00:00:00 2001 From: "Baek Kyu, Kim" Date: Sun, 18 Oct 2026 05:52:34 +0900 Subject: [PATCH] hwmon: (sht4x) Reject incomplete heater command transfers heater_enable_store() treats a zero return from i2c_master_send() as success. It updates the heater state and returns count, so another attempt to enable the heater fails with -EBUSY. i2c-virtio can return zero when the first message fails. Require SHT4X_CMD_LEN before updating the heater state, as sht4x_probe() already does for the reset command. Fixes: 0eed6fc3d2b9 ("hwmon: (sht4x): add heater support") Cc: stable@vger.kernel.org Signed-off-by: Baek Kyu, Kim Link: https://patch.msgid.link/20261017205234.1084949-1-pocj8ur4in@gmail.com Signed-off-by: Guenter Roeck --- drivers/hwmon/sht4x.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/hwmon/sht4x.c b/drivers/hwmon/sht4x.c index 27fddff70354..0bb9227674a8 100644 --- a/drivers/hwmon/sht4x.c +++ b/drivers/hwmon/sht4x.c @@ -287,6 +287,8 @@ static ssize_t heater_enable_store(struct device *dev, ret = i2c_master_send(data->client, &cmd, SHT4X_CMD_LEN); if (ret < 0) return ret; + if (ret != SHT4X_CMD_LEN) + return -EIO; data->heating_complete = get_jiffies_64() + msecs_to_jiffies(heating_time_bound); data->data_pending = true;