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>
This commit is contained in:
Родитель
bdbd0a7f8f
Коммит
050dfc09f8
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче