diff options
author | Sergey Organov <sorganov@gmail.com> | 2019-04-23 08:06:58 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-04-25 11:39:51 +0200 |
commit | 050dfc09f8a43ae41f966d87f81ef35dfad754d5 (patch) | |
tree | 46204634ab99e18cd4accd402cda932d586dd622 /drivers/tty | |
parent | bdbd0a7f8f0342dd545cc3f1e47aa30265807846 (diff) | |
download | linux-next-050dfc09f8a43ae41f966d87f81ef35dfad754d5.tar.gz |
tty: serial_core: fix error code returned by uart_register_driver()
uart_register_driver() returned -ENOMEM on any error, even when
tty_register_driver() call returned another one, such as -EBUSY.
Signed-off-by: Sergey Organov <sorganov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/serial_core.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c index 0decb0bf991d..83f4dd0bfd74 100644 --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -2507,7 +2507,7 @@ static const struct tty_port_operations uart_port_ops = { int uart_register_driver(struct uart_driver *drv) { struct tty_driver *normal; - int i, retval; + int i, retval = -ENOMEM; BUG_ON(drv->state); @@ -2559,7 +2559,7 @@ int uart_register_driver(struct uart_driver *drv) out_kfree: kfree(drv->state); out: - return -ENOMEM; + return retval; } /** |