Skip to content

Commit

Permalink
gpio: mxc: Unlock on error path in mxc_flip_edge()
Browse files Browse the repository at this point in the history
[ Upstream commit 3787035 ]

We recently added locking to this function but one error path was
over looked.  Drop the lock before returning.

Fixes: e546427 ("gpio: mxc: Protect GPIO irqchip RMW with bgpio spinlock")
Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Marek Vasut <marex@denx.de>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
error27 authored and gregkh committed Feb 1, 2023
1 parent b51e3f5 commit 699378c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpio/gpio-mxc.c
Expand Up @@ -236,10 +236,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);
}

Expand Down

0 comments on commit 699378c

Please sign in to comment.