linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] tty/serial/8250: unlock on error in serial8250_register_8250_port()
@ 2016-06-28  9:15 Dan Carpenter
  2016-08-31 13:57 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2016-06-28  9:15 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Yegor Yefremov
  Cc: Jiri Slaby, Andy Shevchenko, Anton Wuerfel, Phillip Raffeck,
	Peter Hurley, Wan Ahmad Zainie, Masahiro Yamada,
	Maciej S. Szmigiero, linux-serial, kernel-janitors

We need to unlock before returning here.

Fixes: 4ef03d328769 ('tty/serial/8250: use mctrl_gpio helpers')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 13ad5c3..a2b849e 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1015,8 +1015,10 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
 
 		gpios = mctrl_gpio_init(&uart->port, 0);
 		if (IS_ERR(gpios)) {
-			if (PTR_ERR(gpios) != -ENOSYS)
-				return PTR_ERR(gpios);
+			if (PTR_ERR(gpios) != -ENOSYS) {
+				ret = PTR_ERR(gpios);
+				goto unlock;
+			}
 		} else
 			uart->gpios = gpios;
 
@@ -1068,6 +1070,7 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
 			ret = 0;
 		}
 	}
+unlock:
 	mutex_unlock(&serial_mutex);
 
 	return ret;

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-08-31 16:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-28  9:15 [patch] tty/serial/8250: unlock on error in serial8250_register_8250_port() Dan Carpenter
2016-08-31 13:57 ` Greg Kroah-Hartman
2016-08-31 16:11   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).