From: "Andrew F. Davis" <afd@ti.com>
To: Dan Carpenter <dan.carpenter@oracle.com>,
Linus Walleij <linus.walleij@linaro.org>
Cc: Alexandre Courbot <gnurou@gmail.com>,
linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] gpio-pisosr: Unlock on error in pisosr_gpio_refresh()
Date: Fri, 19 Feb 2016 21:57:07 +0000 [thread overview]
Message-ID: <56C78FB3.30806@ti.com> (raw)
In-Reply-To: <20160219215330.GA18915@mwanda>
On 02/19/2016 03:53 PM, Dan Carpenter wrote:
> 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,
>
This must get flagged by some tool, looks like [0] beat you to it.
Thanks though,
Andrew
[0]http://www.spinics.net/lists/kernel/msg2191913.html
prev parent reply other threads:[~2016-02-19 21:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-19 21:53 [patch] gpio-pisosr: Unlock on error in pisosr_gpio_refresh() Dan Carpenter
2016-02-19 21:57 ` Andrew F. Davis [this message]
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=56C78FB3.30806@ti.com \
--to=afd@ti.com \
--cc=dan.carpenter@oracle.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