diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2019-07-03 05:59:08 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-07-03 19:28:40 +0200 |
commit | b7a8f766482fa5893ca95cbf83195e60e96e389e (patch) | |
tree | 6ce5c79bc560a5d6f8b56d3bc63417972bbce4ee /drivers/tty | |
parent | 84872dc448fe0ae11fe8412f4966e9c431a45b8f (diff) | |
download | blackbird-op-linux-b7a8f766482fa5893ca95cbf83195e60e96e389e.tar.gz blackbird-op-linux-b7a8f766482fa5893ca95cbf83195e60e96e389e.zip |
serial: 8250: 8250_core: Fix missing unlock on error in serial8250_register_8250_port()
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>
Link: https://lore.kernel.org/r/20190703055908.141294-1-weiyongjun1@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/8250/8250_core.c | 7 |
1 files 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; |