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>
This commit is contained in:
parent
9bcc327844
commit
2b359172e0
|
@ -707,8 +707,10 @@ static int __init mcf_init(void)
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
rc = platform_driver_register(&mcf_platform_driver);
|
rc = platform_driver_register(&mcf_platform_driver);
|
||||||
if (rc)
|
if (rc) {
|
||||||
|
uart_unregister_driver(&mcf_driver);
|
||||||
return rc;
|
return rc;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue