From: Jon Povey Date: Mon, 14 Jun 2010 10:42:10 +0000 (+0900) Subject: USB: g_serial: fix tty cleanup on unload X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b23097b793081358a6d943263c91bae4c955c4e3;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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: Jon Povey Acked-by: David Brownell Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c index a0f79df4c6c2..3e8dcb5455e3 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__);