Commit 7d1c2858 authored by Takashi Iwai's avatar Takashi Iwai Committed by Greg Kroah-Hartman

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: default avatarJean Delvare <jdelvare@suse.de>
Reviewed-by: default avatarJean Delvare <jdelvare@suse.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f4f653e9
......@@ -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);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment