Skip to contentSkip to conversation

tty: Fix tty_port kref screwup

PATCH New Alan Cox 1 participant 1 message Oct 21, 2008 Char and misc drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 tty: Fix tty_port kref screwup

From: Alan Cox <[email protected]>

Pass the brown paper bags please. I changed the semantics of this so the function was supposed to do the extra kref itself then forgot to do the change.. duh....

---

 drivers/char/tty_port.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/char/tty_port.c +1 -1
index 553b0e9..c8f8024 100644
@@ -90,7 +90,7 @@ void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty)
 	spin_lock_irqsave(&port->lock, flags);
 	if (port->tty)
 		tty_kref_put(port->tty);
-	port->tty = tty;
+	port->tty = tty_kref_get(tty);
 	spin_unlock_irqrestore(&port->lock, flags);
 }
 EXPORT_SYMBOL(tty_port_tty_set);