Linux GPIO subsystem development
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Dan Carpenter <error27@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Bartosz Golaszewski <brgl@bgdev.pl>,
	Marc Zyngier <maz@kernel.org>,
	linux-gpio@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] gpio: mxc: Unlock on error path in mxc_flip_edge()
Date: Tue, 24 Jan 2023 16:27:28 +0100	[thread overview]
Message-ID: <76be618d-e0fa-6bf2-7a8f-da422a0e8485@denx.de> (raw)
In-Reply-To: <Y8/3OlSVCK/0wQRj@kili>

On 1/24/23 16:20, Dan Carpenter wrote:
> We recently added locking to this function but one error path was
> over looked.  Drop the lock before returning.
> 
> Fixes: e5464277625c ("gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock")
> Signed-off-by: Dan Carpenter <error27@gmail.com>
> ---
>   drivers/gpio/gpio-mxc.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c
> index 6f673b2f2a1b..9d0cec4b82a3 100644
> --- a/drivers/gpio/gpio-mxc.c
> +++ b/drivers/gpio/gpio-mxc.c
> @@ -249,10 +249,11 @@ static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio)
>   	} else {
>   		pr_err("mxc: invalid configuration for GPIO %d: %x\n",
>   		       gpio, edge);
> -		return;
> +		goto unlock;
>   	}
>   	writel(val | (edge << (bit << 1)), reg);
>   
> +unlock:
>   	raw_spin_unlock_irqrestore(&port->gc.bgpio_lock, flags);
>   }

Acked-by: Marek Vasut <marex@denx.de>

Thanks !

  reply	other threads:[~2023-01-24 15:27 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 15:20 [PATCH] gpio: mxc: Unlock on error path in mxc_flip_edge() Dan Carpenter
2023-01-24 15:27 ` Marek Vasut [this message]
2023-01-25 12:34 ` Bartosz Golaszewski

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=76be618d-e0fa-6bf2-7a8f-da422a0e8485@denx.de \
    --to=marex@denx.de \
    --cc=brgl@bgdev.pl \
    --cc=error27@gmail.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=maz@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