serial: samsung: missing uart_unregister_driver() on error in s3c24xx_serial_modinit()

Add the missing uart_unregister_driver() before return from
s3c24xx_serial_modinit() 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:
Wei Yongjun 2013-05-29 13:47:09 +08:00 committed by Greg Kroah-Hartman
parent 86b40567b9
commit 147275983e
1 changed files with 7 additions and 1 deletions

View File

@ -1798,7 +1798,13 @@ static int __init s3c24xx_serial_modinit(void)
return ret;
}
return platform_driver_register(&samsung_serial_driver);
ret = platform_driver_register(&samsung_serial_driver);
if (ret < 0) {
pr_err("Failed to register platform driver\n");
uart_unregister_driver(&s3c24xx_uart_drv);
}
return ret;
}
static void __exit s3c24xx_serial_modexit(void)