Skip to content

Commit

Permalink
ttyprintk: Fix wrong tty_unregister_driver() call in the error path
Browse files Browse the repository at this point in the history
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 <jdelvare@suse.de>
Reviewed-by: Jean Delvare <jdelvare@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Takashi Iwai authored and Greg Kroah-Hartman committed Apr 16, 2014
1 parent f4f653e commit 7d1c285
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions drivers/char/ttyprintk.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

0 comments on commit 7d1c285

Please sign in to comment.