[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1455873780-31935-1-git-send-email-sudipm.mukherjee@gmail.com>
Date: Fri, 19 Feb 2016 14:53:00 +0530
From: Sudip Mukherjee <sudipm.mukherjee@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Alexandre Courbot <gnurou@...il.com>
Cc: linux-kernel@...r.kernel.org, "Andrew F. Davis" <afd@...com>,
linux-gpio@...r.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@...il.com>
Subject: [PATCH] gpio: pisosr: add missing unlock
If spi_read() fails then we just returned but we missed unlocking the
mutex.
Signed-off-by: Sudip Mukherjee <sudip@...torindia.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
Powered by blists - more mailing lists