kernel - Fix token mismatch in tty code.
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 1 Sep 2010 06:36:14 +0000 (23:36 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 1 Sep 2010 06:36:14 +0000 (23:36 -0700)
* Fix issue when a tty is stopped/started with ^S/^Q related to
  recent tokenization work.

sys/kern/tty_pty.c

index e14416f..fadd7dd 100644 (file)
@@ -553,8 +553,10 @@ ptsstart(struct tty *tp)
        lwkt_gettoken(&tty_token);
        struct pt_ioctl *pti = tp->t_dev->si_drv1;
 
-       if (tp->t_state & TS_TTSTOP)
+       if (tp->t_state & TS_TTSTOP) {
+               lwkt_reltoken(&tty_token);
                return;
+       }
        if (pti) {
                if (pti->pt_flags & PF_STOPPED) {
                        pti->pt_flags &= ~PF_STOPPED;