From: Dan Carpenter <dan.carpenter@oracle.com>
To: Linus Walleij <linus.walleij@linaro.org>, "Andrew F. Davis" <afd@ti.com>
Cc: Alexandre Courbot <gnurou@gmail.com>,
linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: [patch] gpio-pisosr: Unlock on error in pisosr_gpio_refresh()
Date: Fri, 19 Feb 2016 21:53:30 +0000 [thread overview]
Message-ID: <20160219215330.GA18915@mwanda> (raw)
We should unlock before returning if spi_read() fails.
Fixes: df6df93c8a73 ('gpio: Add driver for SPI serializers')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/gpio/gpio-pisosr.c b/drivers/gpio/gpio-pisosr.c
index 58ea08df..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,
next reply other threads:[~2016-02-19 21:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 21:53 Dan Carpenter [this message]
2016-02-19 21:57 ` [patch] gpio-pisosr: Unlock on error in pisosr_gpio_refresh() Andrew F. Davis
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=20160219215330.GA18915@mwanda \
--to=dan.carpenter@oracle.com \
--cc=afd@ti.com \
--cc=gnurou@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@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