summaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-10-27 14:29:31 +0800
committerGuenter Roeck <linux@roeck-us.net>2022-12-04 16:45:02 -0800
commitb744db17abf6a2efc2bfa80870cc88e9799a8ccc (patch)
treef304b6440f143dc366e430b415294625e14a63c6 /drivers/hwmon
parent084ed144c448fd5bc8ed5a58247153fbbfd115c3 (diff)
hwmon: (jc42) Fix missing unlock on error in jc42_write()
Add the missing unlock before return from function jc42_write() in the error handling case. Fixes: 37dedaee8bc6 ("hwmon: (jc42) Convert register access and caching to regmap/regcache") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com> Link: https://lore.kernel.org/r/20221027062931.598247-1-yangyingliang@huawei.com Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/jc42.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
index 0554b41c32bc..6593d81cb901 100644
--- a/drivers/hwmon/jc42.c
+++ b/drivers/hwmon/jc42.c
@@ -350,7 +350,7 @@ static int jc42_write(struct device *dev, enum hwmon_sensor_types type,
ret = regmap_read(data->regmap, JC42_REG_TEMP_CRITICAL,
&regval);
if (ret)
- return ret;
+ break;
/*
* JC42.4 compliant chips only support four hysteresis values.