提交 1b615bee 编写于 作者: L Libo Chen 提交者: Greg Kroah-Hartman

driver: tty: add missing unregister in err case

when platform_driver_register broken, we should unregister ucc_uart_driver
Signed-off-by: NLibo chen <libo.chen@huawei.com>
Acked-by: NTimur Tabi <timur@tabi.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 14727598
...@@ -1517,9 +1517,11 @@ static int __init ucc_uart_init(void) ...@@ -1517,9 +1517,11 @@ static int __init ucc_uart_init(void)
} }
ret = platform_driver_register(&ucc_uart_of_driver); ret = platform_driver_register(&ucc_uart_of_driver);
if (ret) if (ret) {
printk(KERN_ERR printk(KERN_ERR
"ucc-uart: could not register platform driver\n"); "ucc-uart: could not register platform driver\n");
uart_unregister_driver(&ucc_uart_driver);
}
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册