Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern check_pty(): simple_unlock() might have been called...



details:   https://anonhg.NetBSD.org/src/rev/000ac899173a
branches:  trunk
changeset: 499421:000ac899173a
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Nov 19 22:34:56 2000 +0000

description:
check_pty(): simple_unlock() might have been called even if the lock was
        not locked previously in some cases; unlock only if the lock is held

diffstat:

 sys/kern/tty_pty.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (19 lines):

diff -r df28392e2d7b -r 000ac899173a sys/kern/tty_pty.c
--- a/sys/kern/tty_pty.c        Sun Nov 19 20:48:20 2000 +0000
+++ b/sys/kern/tty_pty.c        Sun Nov 19 22:34:56 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty_pty.c,v 1.51 2000/11/05 15:37:09 jdolecek Exp $    */
+/*     $NetBSD: tty_pty.c,v 1.52 2000/11/19 22:34:56 jdolecek Exp $    */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -135,7 +135,8 @@
                if (minor(dev) >= maxptys) {
            limit_reached:
                        tablefull("pty", "increase kern.maxptys");
-                       simple_unlock(&pt_softc_mutex);
+                       if (simple_lock_held(&pt_softc_mutex))
+                               simple_unlock(&pt_softc_mutex);
                        return (ENXIO);
                }
 



Home | Main Index | Thread Index | Old Index