Message ID | 20221027062931.598247-1-yangyingliang@huawei.com (mailing list archive) |
---|---|
State | Accepted |
Headers | show |
Series | [-next] hwmon: (jc42) Fix missing unlock on error in jc42_write() | expand |
On Thu, Oct 27, 2022 at 8:31 AM Yang Yingliang <yangyingliang@huawei.com> wrote: > > 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> Thanks for spotting and fixing this issue!
On Thu, Oct 27, 2022 at 02:29:31PM +0800, Yang Yingliang wrote: > 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> Excellent catch. Applied to hwmon-next. Thanks, Guenter > --- > drivers/hwmon/jc42.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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, > ®val); > if (ret) > - return ret; > + break; > > /* > * JC42.4 compliant chips only support four hysteresis values.
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, ®val); if (ret) - return ret; + break; /* * JC42.4 compliant chips only support four hysteresis values.
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> --- drivers/hwmon/jc42.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)