Commit b23097b7 authored by Jon Povey's avatar Jon Povey Committed by Greg Kroah-Hartman

USB: g_serial: fix tty cleanup on unload

Call put_tty_driver() in cleanup function, to fix Oops when trying to open
gadget serial char device after module unload.
Signed-off-by: default avatarJon Povey <jon.povey@racelogic.co.uk>
Acked-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 44a0c019
...@@ -1184,6 +1184,7 @@ void gserial_cleanup(void) ...@@ -1184,6 +1184,7 @@ void gserial_cleanup(void)
n_ports = 0; n_ports = 0;
tty_unregister_driver(gs_tty_driver); tty_unregister_driver(gs_tty_driver);
put_tty_driver(gs_tty_driver);
gs_tty_driver = NULL; gs_tty_driver = NULL;
pr_debug("%s: cleaned up ttyGS* support\n", __func__); pr_debug("%s: cleaned up ttyGS* support\n", __func__);
......
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