gpio: mxc: Unlock on error path in mxc_flip_edge()
Subsystems (3)
PATCH 1/1 gpio: mxc: Unlock on error path in mxc_flip_edge()
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 <[email protected]>
--- drivers/gpio/gpio-mxc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpio/gpio-mxc.c +2 -1
@@ -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); }
Signature · 1 line
2.35.1
Quoted 15 lines · Dan Carpenter
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 <[email protected]>--- drivers/gpio/gpio-mxc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpio/gpio-mxc.c +0
-0@@ -249,10 +249,11 @@ static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio) }else {
drivers/gpio/gpio-mxc.c static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio) · line 258
Quoted 10 lines
drivers/gpio/gpio-mxc.c +2
-1pr_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 <[email protected]>
Thanks !
Bartosz Golaszewski
AppliedQuoted 28 lines · Dan Carpenter
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 <[email protected]>--- drivers/gpio/gpio-mxc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpio/gpio-mxc.c +2
-2@@ -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); } --
Quoted 2 lines
2.35.1
Queued for fixes, thanks!
Bart