serial: mcf: missing uart_unregister_driver() on error in mcf_init()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Thu, 25 Apr 2013 01:17:23 +0000 (09:17 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 May 2013 18:54:56 +0000 (11:54 -0700)
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>
drivers/tty/serial/mcf.c

index e956377a38fe53e299766724c278a05a35d802c4..65be0c00c4bff3f802549a23dfe34515a5a03b54 100644 (file)
@@ -707,8 +707,10 @@ static int __init mcf_init(void)
        if (rc)
                return rc;
        rc = platform_driver_register(&mcf_platform_driver);
-       if (rc)
+       if (rc) {
+               uart_unregister_driver(&mcf_driver);
                return rc;
+       }
        return 0;
 }