]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
serial: samsung: missing uart_unregister_driver() on error in s3c24xx_serial_modinit()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Wed, 29 May 2013 05:47:09 +0000 (13:47 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Jun 2013 17:30:43 +0000 (10:30 -0700)
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>
drivers/tty/serial/samsung.c

index 89429410a245e7b1d97b6602776a2b9be20881ab..1c2b8c31fde11e0176dc4e4af1c7aebb9b489cdd 100644 (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)