mirror of
https://github.com/torvalds/linux.git
synced 2024-12-13 06:32:50 +00:00
driver: tty: add missing unregister in err case
when platform_driver_register broken, we should unregister ucc_uart_driver Signed-off-by: Libo chen <libo.chen@huawei.com> Acked-by: Timur Tabi <timur@tabi.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
147275983e
commit
1b615beec7
@ -1517,9 +1517,11 @@ static int __init ucc_uart_init(void)
|
||||
}
|
||||
|
||||
ret = platform_driver_register(&ucc_uart_of_driver);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
printk(KERN_ERR
|
||||
"ucc-uart: could not register platform driver\n");
|
||||
uart_unregister_driver(&ucc_uart_driver);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user