Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [PATCH -next] hwmon: (jc42) Fix missing unlock on error in jc42_write()
@ 2022-10-27  6:29 Yang Yingliang
  2022-10-27  6:39 ` Martin Blumenstingl
  2022-10-27 13:07 ` Guenter Roeck
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Yingliang @ 2022-10-27  6:29 UTC (permalink / raw)
  To: linux-hwmon; +Cc: martin.blumenstingl, linux, jdelvare, yangyingliang

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

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.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] hwmon: (jc42) Fix missing unlock on error in jc42_write()
  2022-10-27  6:29 [PATCH -next] hwmon: (jc42) Fix missing unlock on error in jc42_write() Yang Yingliang
@ 2022-10-27  6:39 ` Martin Blumenstingl
  2022-10-27 13:07 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Martin Blumenstingl @ 2022-10-27  6:39 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-hwmon, linux, jdelvare

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!

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH -next] hwmon: (jc42) Fix missing unlock on error in jc42_write()
  2022-10-27  6:29 [PATCH -next] hwmon: (jc42) Fix missing unlock on error in jc42_write() Yang Yingliang
  2022-10-27  6:39 ` Martin Blumenstingl
@ 2022-10-27 13:07 ` Guenter Roeck
  1 sibling, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2022-10-27 13:07 UTC (permalink / raw)
  To: Yang Yingliang; +Cc: linux-hwmon, martin.blumenstingl, jdelvare

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,
>  				  &regval);
>  		if (ret)
> -			return ret;
> +			break;
>  
>  		/*
>  		 * JC42.4 compliant chips only support four hysteresis values.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-27 13:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-27  6:29 [PATCH -next] hwmon: (jc42) Fix missing unlock on error in jc42_write() Yang Yingliang
2022-10-27  6:39 ` Martin Blumenstingl
2022-10-27 13:07 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox