]> Pileus Git - ~andy/linux/commitdiff
tty: Allow uart_register/unregister/register
authorAlan Cox <alan@linux.intel.com>
Mon, 14 May 2012 13:51:22 +0000 (14:51 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 May 2012 16:04:28 +0000 (09:04 -0700)
This is legitimate but because we don't clear the drv->state pointer in the
unregister code causes a bogus BUG().

Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=42880
Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/serial_core.c

index 59fb3ba1e7cace8eec241685c35bf41155e243c7..a21dc8e3b7c0cf56ed808e006499abf4b661a217 100644 (file)
@@ -2282,6 +2282,7 @@ void uart_unregister_driver(struct uart_driver *drv)
        tty_unregister_driver(p);
        put_tty_driver(p);
        kfree(drv->state);
+       drv->state = NULL;
        drv->tty_driver = NULL;
 }