linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] gpiolib: unlock on error in gpiod_set_debounce()
       [not found] <5225c32f.kWadywtP9mkLJ38j%fengguang.wu@intel.com>
@ 2013-09-03 12:15 ` Dan Carpenter
  2013-09-04  5:51   ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-09-03 12:15 UTC (permalink / raw)
  To: Linus Walleij; +Cc: linux-gpio, kbuild, Fengguang Wu

There is a missing unlock on error here.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 0eb9cba..3c01782 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -1783,7 +1783,8 @@ static int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
 	if (!chip->set || !chip->set_debounce) {
 		pr_warn("%s: missing set() or set_debounce() operations\n",
 			__func__);
-		return -EIO;
+		status = -EIO;
+		goto fail;
 	}
 
 	status = gpio_ensure_requested(desc);

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

* Re: [patch] gpiolib: unlock on error in gpiod_set_debounce()
  2013-09-03 12:15 ` [patch] gpiolib: unlock on error in gpiod_set_debounce() Dan Carpenter
@ 2013-09-04  5:51   ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2013-09-04  5:51 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: linux-gpio@vger.kernel.org, kbuild, Fengguang Wu

On Tue, Sep 3, 2013 at 2:15 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:

> There is a missing unlock on error here.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
> index 0eb9cba..3c01782 100644
> --- a/drivers/gpio/gpiolib.c
> +++ b/drivers/gpio/gpiolib.c
> @@ -1783,7 +1783,8 @@ static int gpiod_set_debounce(struct gpio_desc *desc, unsigned debounce)
>         if (!chip->set || !chip->set_debounce) {
>                 pr_warn("%s: missing set() or set_debounce() operations\n",
>                         __func__);
> -               return -EIO;
> +               status = -EIO;
> +               goto fail;
>         }

Yeah I screwed up. I queued another fix though, moving the locking below
the check instead.

Yours,
Linus Walleij

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

end of thread, other threads:[~2013-09-04  5:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <5225c32f.kWadywtP9mkLJ38j%fengguang.wu@intel.com>
2013-09-03 12:15 ` [patch] gpiolib: unlock on error in gpiod_set_debounce() Dan Carpenter
2013-09-04  5:51   ` Linus Walleij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).