USB: g_serial: fix tty cleanup on unload
authorJon Povey <jon.povey@racelogic.co.uk>
Mon, 14 Jun 2010 10:42:10 +0000 (19:42 +0900)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 30 Jun 2010 15:16:05 +0000 (08:16 -0700)
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>
drivers/usb/gadget/u_serial.c

index a0f79df4c6c2086895b2562a443bbafc25359ade..3e8dcb5455e3a4912f7bc0fc525b69c524cade7f 100644 (file)
@@ -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__);