Commit 050dfc09 authored by Sergey Organov's avatar Sergey Organov Committed by Greg Kroah-Hartman

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: default avatarSergey Organov <sorganov@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bdbd0a7f
...@@ -2507,7 +2507,7 @@ static const struct tty_port_operations uart_port_ops = { ...@@ -2507,7 +2507,7 @@ static const struct tty_port_operations uart_port_ops = {
int uart_register_driver(struct uart_driver *drv) int uart_register_driver(struct uart_driver *drv)
{ {
struct tty_driver *normal; struct tty_driver *normal;
int i, retval; int i, retval = -ENOMEM;
BUG_ON(drv->state); BUG_ON(drv->state);
...@@ -2559,7 +2559,7 @@ int uart_register_driver(struct uart_driver *drv) ...@@ -2559,7 +2559,7 @@ int uart_register_driver(struct uart_driver *drv)
out_kfree: out_kfree:
kfree(drv->state); kfree(drv->state);
out: out:
return -ENOMEM; return retval;
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment