Skip to content

Commit

Permalink
serial: mcf: missing uart_unregister_driver() on error in mcf_init()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed May 20, 2013
1 parent 9bcc327 commit 2b35917
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/tty/serial/mcf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 2b35917

Please sign in to comment.