hwmon: (jc42) Fix missing unlock on error in jc42_write()
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")
Signed-off-by Yang Yingliang <[email protected]>
--- drivers/hwmon/jc42.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwmon/jc42.c +1 -1
@@ -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.
Signature · 1 line
2.25.1
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")Signed-off-by Yang Yingliang <[email protected]>
Reviewed-by Martin Blumenstingl <[email protected]>
Thanks for spotting and fixing this issue!
Guenter Roeck
maintainerQuoted 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")Signed-off-by Yang Yingliang <[email protected]>Reviewed-by Martin Blumenstingl <[email protected]>
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@@ -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.