summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2004-02-23 21:17:54 +0000
committerbeck <beck@openbsd.org>2004-02-23 21:17:54 +0000
commit22f494918d33bf0f73dc3fc2028a0085c6e74395 (patch)
tree0dca499bf40bba225c04347ec3e3a3f1c00c6da9
parentbogus leftover SRCS line (diff)
downloadwireguard-openbsd-22f494918d33bf0f73dc3fc2028a0085c6e74395.tar.xz
wireguard-openbsd-22f494918d33bf0f73dc3fc2028a0085c6e74395.zip
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@
-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