From bce2647e260eb4a11cbe037f26206d96708e77af Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Mon, 23 Feb 2004 21:17:55 +0000 Subject: 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@ --- sys/kern/tty_pty.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sys') 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 -- cgit v1.2.3