Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

serial: mcf: missing uart_unregister_driver() on error in mcf_init()

Add the missing uart_unregister_driver() before return
from mcf_init() in the error handling case.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Wei Yongjun and committed by
Greg Kroah-Hartman
2b359172 9bcc3278

+3 -1
+3 -1
drivers/tty/serial/mcf.c
··· 707 707 if (rc) 708 708 return rc; 709 709 rc = platform_driver_register(&mcf_platform_driver); 710 - if (rc) 710 + if (rc) { 711 + uart_unregister_driver(&mcf_driver); 711 712 return rc; 713 + } 712 714 return 0; 713 715 } 714 716