linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: pisosr: add missing unlock
@ 2016-02-19  9:23 Sudip Mukherjee
  2016-02-19 11:56 ` Linus Walleij
  0 siblings, 1 reply; 2+ messages in thread
From: Sudip Mukherjee @ 2016-02-19  9:23 UTC (permalink / raw)
  To: Linus Walleij, Alexandre Courbot
  Cc: linux-kernel, Andrew F. Davis, linux-gpio, Sudip Mukherjee

If spi_read() fails then we just returned but we missed unlocking the
mutex.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/gpio/gpio-pisosr.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c
index 58ea08d..f9f1074 100644
--- a/drivers/gpio/gpio-pisosr.c
+++ b/drivers/gpio/gpio-pisosr.c
@@ -53,12 +53,10 @@ static int pisosr_gpio_refresh(struct pisosr_gpio *gpio)
 	}
 
 	ret = spi_read(gpio->spi, gpio->buffer, gpio->buffer_size);
-	if (ret)
-		return ret;
 
 	mutex_unlock(&gpio->lock);
 
-	return 0;
+	return ret;
 }
 
 static int pisosr_gpio_get_direction(struct gpio_chip *chip,
-- 
1.9.1

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

* Re: [PATCH] gpio: pisosr: add missing unlock
  2016-02-19  9:23 [PATCH] gpio: pisosr: add missing unlock Sudip Mukherjee
@ 2016-02-19 11:56 ` Linus Walleij
  0 siblings, 0 replies; 2+ messages in thread
From: Linus Walleij @ 2016-02-19 11:56 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Alexandre Courbot, linux-kernel@vger.kernel.org, Andrew F. Davis,
	linux-gpio@vger.kernel.org

On Fri, Feb 19, 2016 at 10:23 AM, Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:

> If spi_read() fails then we just returned but we missed unlocking the
> mutex.
>
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

Obviously correct, patch applied.

Yours,
Linus Walleij

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

end of thread, other threads:[~2016-02-19 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-19  9:23 [PATCH] gpio: pisosr: add missing unlock Sudip Mukherjee
2016-02-19 11:56 ` 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).