From: Takashi Iwai Date: Wed, 2 Apr 2014 12:45:21 +0000 (+0200) Subject: ttyprintk: Fix wrong tty_unregister_driver() call in the error path X-Git-Tag: firefly_0821_release~176^2~4025^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7d1c2858c49095ab748f55354b89dbd6b18d28b9;p=firefly-linux-kernel-4.4.55.git ttyprintk: Fix wrong tty_unregister_driver() call in the error path ttyprintk driver calls tty_unregister_driver() wrongly in the error path of tty_register_driver(). Also, setting ttyprintk_driver to NULL is utterly superfluous, so let's get rid of it, too. Reported-by: Jean Delvare Reviewed-by: Jean Delvare Signed-off-by: Takashi Iwai Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c index daea84c41743..2a39c5790364 100644 --- a/drivers/char/ttyprintk.c +++ b/drivers/char/ttyprintk.c @@ -210,10 +210,8 @@ static int __init ttyprintk_init(void) return 0; error: - tty_unregister_driver(ttyprintk_driver); put_tty_driver(ttyprintk_driver); tty_port_destroy(&tpk_port.port); - ttyprintk_driver = NULL; return ret; } device_initcall(ttyprintk_init);