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

* Re: [patch] tty/serial/8250: unlock on error in serial8250_register_8250_port()
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2016-08-31 13:57 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Yegor Yefremov, Jiri Slaby, Andy Shevchenko, Anton Wuerfel,
	Phillip Raffeck, Peter Hurley, Wan Ahmad Zainie, Masahiro Yamada,
	Maciej S. Szmigiero, linux-serial, kernel-janitors

On Tue, Jun 28, 2016 at 12:15:22PM +0300, Dan Carpenter wrote:
> We need to unlock before returning here.
> 
> Fixes: 4ef03d328769 ('tty/serial/8250: use mctrl_gpio helpers')

I ended up reverting this patch, perhaps this is the problem that people
were having with this patch?

thanks,

greg k-h

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

* Re: [patch] tty/serial/8250: unlock on error in serial8250_register_8250_port()
  2016-08-31 13:57 ` Greg Kroah-Hartman
@ 2016-08-31 16:11   ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2016-08-31 16:11 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Dan Carpenter
  Cc: Yegor Yefremov, Jiri Slaby, Anton Wuerfel, Phillip Raffeck,
	Peter Hurley, Wan Ahmad Zainie, Masahiro Yamada,
	Maciej S. Szmigiero, linux-serial, kernel-janitors

On Wed, 2016-08-31 at 15:57 +0200, Greg Kroah-Hartman wrote:
> On Tue, Jun 28, 2016 at 12:15:22PM +0300, Dan Carpenter wrote:
> > 
> > We need to unlock before returning here.
> > 
> > Fixes: 4ef03d328769 ('tty/serial/8250: use mctrl_gpio helpers')
> 
> I ended up reverting this patch, perhaps this is the problem that
> people
> were having with this patch?

Nope, I tried this fix, didn't help.
Mika put the details in his message I mentioned in the patch:

Link: https://lkml.kernel.org/r/20160809130229.GN1729@lahna.fi.intel.com

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply	[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).