Re: [PATCH -next] gpio: sim: fix missing unlock on error in gpio_sim_config_commit_item()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 30, 2021 at 5:54 AM Wei Yongjun <weiyongjun1@xxxxxxxxxx> 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@xxxxxxxxxx>
> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>
> ---
>  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



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux