From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Alexandre Courbot <gnurou@gmail.com>
Cc: linux-kernel@vger.kernel.org, "Andrew F. Davis" <afd@ti.com>,
linux-gpio@vger.kernel.org,
Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Subject: [PATCH] gpio: pisosr: add missing unlock
Date: Fri, 19 Feb 2016 14:53:00 +0530 [thread overview]
Message-ID: <1455873780-31935-1-git-send-email-sudipm.mukherjee@gmail.com> (raw)
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
next reply other threads:[~2016-02-19 9:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 9:23 Sudip Mukherjee [this message]
2016-02-19 11:56 ` [PATCH] gpio: pisosr: add missing unlock Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1455873780-31935-1-git-send-email-sudipm.mukherjee@gmail.com \
--to=sudipm.mukherjee@gmail.com \
--cc=afd@ti.com \
--cc=gnurou@gmail.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).