Skip to content

Commit

Permalink
USB: g_serial: fix tty cleanup on unload
Browse files Browse the repository at this point in the history
Call put_tty_driver() in cleanup function, to fix Oops when trying to open
gadget serial char device after module unload.

Signed-off-by: Jon Povey <jon.povey@racelogic.co.uk>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Jon Povey authored and Greg Kroah-Hartman committed Jun 30, 2010
1 parent 44a0c01 commit b23097b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/usb/gadget/u_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ void gserial_cleanup(void)
n_ports = 0;

tty_unregister_driver(gs_tty_driver);
put_tty_driver(gs_tty_driver);
gs_tty_driver = NULL;

pr_debug("%s: cleaned up ttyGS* support\n", __func__);
Expand Down

0 comments on commit b23097b

Please sign in to comment.