Skip to contentSkip to conversation

tty: Allow uart_register/unregister/register

PATCH New Alan Cox 1 participant 1 message May 14, 2012 TTY layer and serial drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 tty: Allow uart_register/unregister/register

From: Alan Cox <[email protected]>

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

---

 drivers/tty/serial/serial_core.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/tty/serial/serial_core.c +1 -0
index 9c4c05b..246b823 100644
@@ -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;
 }