From: Yang Yingliang Date: Thu, 27 Oct 2022 06:29:31 +0000 (+0800) Subject: hwmon: (jc42) Fix missing unlock on error in jc42_write() X-Git-Tag: v6.1.8~906 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=48c509f3f1210d3a2011e7fd4bae6dfc781c5243;p=platform%2Fkernel%2Flinux-starfive.git hwmon: (jc42) Fix missing unlock on error in jc42_write() [ Upstream commit b744db17abf6a2efc2bfa80870cc88e9799a8ccc ] 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 Reviewed-by: Martin Blumenstingl Link: https://lore.kernel.org/r/20221027062931.598247-1-yangyingliang@huawei.com Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Guenter Roeck Signed-off-by: Sasha Levin --- diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c index 0554b41..6593d81 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, ®val); if (ret) - return ret; + break; /* * JC42.4 compliant chips only support four hysteresis values.