From 62d488187b265f667d4a8b12b1d00ccc66c80e27 Mon Sep 17 00:00:00 2001 From: Jon Povey Date: Mon, 14 Jun 2010 19:42:10 +0900 Subject: [PATCH] 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 --- drivers/usb/gadget/u_serial.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index a0f79df4c6c..3e8dcb5455e 100644 --- a/drivers/usb/gadget/u_serial.c +++ b/drivers/usb/gadget/u_serial.c @@ -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__); -- 2.11.4.GIT