提交 050dfc09 编写于 作者: S Sergey Organov 提交者: 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: NSergey Organov <sorganov@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册