* [PATCH -next] gpio: sim: fix missing unlock on error in gpio_sim_config_commit_item()
@ 2021-10-30 4:07 Wei Yongjun
2021-10-30 15:13 ` Bartosz Golaszewski
0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2021-10-30 4:07 UTC (permalink / raw)
To: weiyongjun1, Linus Walleij, Bartosz Golaszewski
Cc: linux-gpio, kernel-janitors, Hulk Robot
Add the missing unlock before return from function
gpio_sim_config_commit_item() in the error handling
case.
Fixes: b48f6b466e44 ("gpio: sim: new testing module")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/gpio/gpio-sim.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
index d8bf84b604d9..e2113092f85b 100644
--- a/drivers/gpio/gpio-sim.c
+++ b/drivers/gpio/gpio-sim.c
@@ -789,8 +789,10 @@ static int gpio_sim_config_commit_item(struct config_item *item)
config->num_line_names);
fwnode = fwnode_create_software_node(properties, NULL);
- if (IS_ERR(fwnode))
+ if (IS_ERR(fwnode)) {
+ mutex_unlock(&config->lock);
return PTR_ERR(fwnode);
+ }
pdevinfo.name = "gpio-sim";
pdevinfo.fwnode = fwnode;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH -next] gpio: sim: fix missing unlock on error in gpio_sim_config_commit_item()
2021-10-30 4:07 [PATCH -next] gpio: sim: fix missing unlock on error in gpio_sim_config_commit_item() Wei Yongjun
@ 2021-10-30 15:13 ` Bartosz Golaszewski
0 siblings, 0 replies; 2+ messages in thread
From: Bartosz Golaszewski @ 2021-10-30 15:13 UTC (permalink / raw)
To: Wei Yongjun
Cc: Linus Walleij, open list:GPIO SUBSYSTEM, kernel-janitors, Hulk Robot
On Sat, Oct 30, 2021 at 5:54 AM Wei Yongjun <weiyongjun1@huawei.com> wrote:
>
> Add the missing unlock before return from function
> gpio_sim_config_commit_item() in the error handling
> case.
>
> Fixes: b48f6b466e44 ("gpio: sim: new testing module")
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
> ---
> drivers/gpio/gpio-sim.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-sim.c b/drivers/gpio/gpio-sim.c
> index d8bf84b604d9..e2113092f85b 100644
> --- a/drivers/gpio/gpio-sim.c
> +++ b/drivers/gpio/gpio-sim.c
> @@ -789,8 +789,10 @@ static int gpio_sim_config_commit_item(struct config_item *item)
> config->num_line_names);
>
> fwnode = fwnode_create_software_node(properties, NULL);
> - if (IS_ERR(fwnode))
> + if (IS_ERR(fwnode)) {
> + mutex_unlock(&config->lock);
> return PTR_ERR(fwnode);
> + }
>
> pdevinfo.name = "gpio-sim";
> pdevinfo.fwnode = fwnode;
>
Applied, thanks!
Bart
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-30 15:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-30 4:07 [PATCH -next] gpio: sim: fix missing unlock on error in gpio_sim_config_commit_item() Wei Yongjun
2021-10-30 15:13 ` Bartosz Golaszewski
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.