summaryrefslogtreecommitdiff
path: root/drivers/hwmon/aht10.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/aht10.c')
-rw-r--r--drivers/hwmon/aht10.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/hwmon/aht10.c b/drivers/hwmon/aht10.c
index c70d8c2d0c1f..2d9770cb4401 100644
--- a/drivers/hwmon/aht10.c
+++ b/drivers/hwmon/aht10.c
@@ -138,8 +138,10 @@ static int aht10_read_values(struct aht10_data *data)
mutex_lock(&data->lock);
if (aht10_polltime_expired(data)) {
res = i2c_master_send(client, cmd_meas, sizeof(cmd_meas));
- if (res < 0)
+ if (res < 0) {
+ mutex_unlock(&data->lock);
return res;
+ }
usleep_range(AHT10_MEAS_DELAY,
AHT10_MEAS_DELAY + AHT10_DELAY_EXTRA);