diff mbox

gpio: pisosr: add missing unlock

Message ID 1455873780-31935-1-git-send-email-sudipm.mukherjee@gmail.com
State New
Headers show

Commit Message

Sudip Mukherjee Feb. 19, 2016, 9:23 a.m. UTC
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(-)

Comments

Linus Walleij Feb. 19, 2016, 11:56 a.m. UTC | #1
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
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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,