tty/serial/8250: unlock on error in serial8250_register_8250_port()
Subsystems (2)
PATCH 1/1 tty/serial/8250: unlock on error in serial8250_register_8250_port()
We need to unlock before returning here.
Fixes 4ef03d328769 ('tty/serial/8250: use mctrl_gpio helpers')
Signed-off-by Dan Carpenter <[email protected]>
drivers/tty/serial/8250/8250_core.c +5 -2
@@ -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;
Greg Kroah-Hartman
maintainerQuoted 3 lines · Dan Carpenter
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
Quoted 9 lines · Greg Kroah-Hartman
Quoted 4 lines · Dan Carpenter
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:
Signature · 2 lines
Andy Shevchenko <[email protected]> Intel Finland Oy