summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2004-02-23 21:17:55 +0000
committerBob Beck <beck@cvs.openbsd.org>2004-02-23 21:17:55 +0000
commitbce2647e260eb4a11cbe037f26206d96708e77af (patch)
tree11a976deef5a8e6ffc429e48a997dc790fc67b04 /sys/kern
parent858d38040c4f863a2ec6bde7e2aed3368cc4afa0 (diff)
Make sure we allow for the time when check_pty has not yet been called
before we get invoked, by making sure getfree thinks an unused and unallocated pt_softc entry is actually free rather than following NULL. ok cedric@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/tty_pty.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index c891986fd1e..f4cf902e880 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.19 2004/02/10 21:06:50 millert Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.20 2004/02/23 21:17:54 beck Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -1005,7 +1005,8 @@ static __inline int
pty_isfree_locked(int minor)
{
struct pt_softc *pt = pt_softc[minor];
- return (pt->pt_tty == NULL || pt->pt_tty->t_oproc == NULL);
+ return (pt == NULL || pt->pt_tty == NULL ||
+ pt->pt_tty->t_oproc == NULL);
}
static int