]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/char/tty_port.c
tty: Fix tty_port kref screwup
[linux-2.6-omap-h63xx.git] / drivers / char / tty_port.c
index 553b0e9d8d17a5513747337ddf5bcf49caaba95b..c8f8024cb40e5d6b4fcc6ad1a8f4408104e9f81a 100644 (file)
@@ -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);