From: Libo Chen Date: Wed, 29 May 2013 02:33:16 +0000 (+0800) Subject: driver: tty: add missing unregister in err case X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1b615beec7e8a1c40158c69a142e9e9832a6f7ad;p=linux-beck.git driver: tty: add missing unregister in err case when platform_driver_register broken, we should unregister ucc_uart_driver Signed-off-by: Libo chen Acked-by: Timur Tabi Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index c8ab8e45e1b9..88317482b81f 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -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; }