kernel - Fix bug in last commit
authorMatthew Dillon <dillon@apollo.backplane.com>
Thu, 3 Nov 2011 20:41:48 +0000 (13:41 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Thu, 3 Nov 2011 20:41:48 +0000 (13:41 -0700)
* Ooops, lwkt_gettoken->lwkt_reltoken.

Reported-by: ftigeot
sys/kern/tty_tty.c

index e427db7..5f44928 100644 (file)
@@ -224,7 +224,7 @@ cttyioctl(struct dev_ioctl_args *ap)
        ttyvp = cttyvp(p);
        if (ttyvp == NULL) {
                lwkt_reltoken(&proc_token);
-               lwkt_gettoken(&p->p_token);
+               lwkt_reltoken(&p->p_token);
                return (EIO);
        }
        /*
@@ -233,23 +233,23 @@ cttyioctl(struct dev_ioctl_args *ap)
         */
        if (ap->a_cmd == TIOCSCTTY) {
                lwkt_reltoken(&proc_token);
-               lwkt_gettoken(&p->p_token);
+               lwkt_reltoken(&p->p_token);
                return EINVAL;
        }
        if (ap->a_cmd == TIOCNOTTY) {
                if (!SESS_LEADER(p)) {
                        p->p_flag &= ~P_CONTROLT;
                        lwkt_reltoken(&proc_token);
-                       lwkt_gettoken(&p->p_token);
+                       lwkt_reltoken(&p->p_token);
                        return (0);
                } else {
                        lwkt_reltoken(&proc_token);
-                       lwkt_gettoken(&p->p_token);
+                       lwkt_reltoken(&p->p_token);
                        return (EINVAL);
                }
        }
        lwkt_reltoken(&proc_token);
-       lwkt_gettoken(&p->p_token);
+       lwkt_reltoken(&p->p_token);
 
        return (VOP_IOCTL(ttyvp, ap->a_cmd, ap->a_data, ap->a_fflag,
                          ap->a_cred, ap->a_sysmsg));