From: Jon Povey Date: Mon, 14 Jun 2010 10:42:10 +0000 (+0900) Subject: USB: g_serial: fix tty cleanup on unload X-Git-Tag: v2.6.33.7~44 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=725861b20b3c1309eb67f46289efcdc9b41ffff8;p=karo-tx-linux.git USB: g_serial: fix tty cleanup on unload commit b23097b793081358a6d943263c91bae4c955c4e3 upstream. 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 Acked-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index f10311768f90..9e5f9f1e47a2 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c @@ -1183,6 +1183,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__);