All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] serial: 8250: 8250_core: Fix missing unlock on error in serial8250_register_8250_port(
@ 2019-07-03  5:59 Wei Yongjun
  2019-07-03  7:47 ` [PATCH -next] serial: 8250: 8250_core: Fix missing unlock on error in serial8250_register_8250_p walter harms
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2019-07-03  5:59 UTC (permalink / raw)
  To: kernel-janitors

Add the missing unlock before return from function serial8250_register_8250_port()
in the error handling case.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/tty/serial/8250/8250_core.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index a4470771005f..df3bcc0b2d74 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -1026,8 +1026,10 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
 		if (!has_acpi_companion(uart->port.dev)) {
 			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 out_unlock;
+				}
 			} else {
 				uart->gpios = gpios;
 			}
@@ -1099,6 +1101,7 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
 		}
 	}
 
+out_unlock:
 	mutex_unlock(&serial_mutex);
 
 	return ret;

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

end of thread, other threads:[~2019-07-03  7:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-03  5:59 [PATCH -next] serial: 8250: 8250_core: Fix missing unlock on error in serial8250_register_8250_port( Wei Yongjun
2019-07-03  7:47 ` [PATCH -next] serial: 8250: 8250_core: Fix missing unlock on error in serial8250_register_8250_p walter harms

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.