Skip to contentSkip to conversation

hwmon: (jc42) Fix missing unlock on error in jc42_write()

PATCH In review Yang Yingliang 3 participants 3 messages Oct 27, 2022 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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")
---
 drivers/hwmon/jc42.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/jc42.c +1 -1
index 0554b41c32bc..6593d81cb901 100644
@@ -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.
Signature · 1 line
2.25.1
maintainer
#2 lore raw
In reply to Yang Yingliang
Quoted 6 lines · Yang Yingliang

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")

Excellent catch. Applied to hwmon-next.

Thanks,
Guenter

Quoted 17 lines
---
 drivers/hwmon/jc42.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/jc42.c +1 -1
index 0554b41c32bc..6593d81cb901 100644
@@ -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.