diff options
| author | rin <rin@NetBSD.org> | 2019-07-21 16:10:37 +0000 |
|---|---|---|
| committer | rin <rin@NetBSD.org> | 2019-07-21 16:10:37 +0000 |
| commit | 55d7ba263cfa4694bbcf264d9914e5f8ffa6ee89 (patch) | |
| tree | d506f77e9f192eb480f2a04305be8ba51eba5934 /sys/dev/ic | |
| parent | c0cc41c550c76b010d6389a4c25a2f6481398fef (diff) | |
Fix panic due to inconsistent lock states of tty_lock in zsparam().
Tested on mac68k.
Diffstat (limited to 'sys/dev/ic')
| -rw-r--r-- | sys/dev/ic/z8530tty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/z8530tty.c b/sys/dev/ic/z8530tty.c index 395e1c4b434..4b2aad5e827 100644 --- a/sys/dev/ic/z8530tty.c +++ b/sys/dev/ic/z8530tty.c @@ -1,4 +1,4 @@ -/* $NetBSD: z8530tty.c,v 1.132 2017/10/31 10:45:19 martin Exp $ */ +/* $NetBSD: z8530tty.c,v 1.133 2019/07/21 16:10:37 rin Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998, 1999 @@ -137,7 +137,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.132 2017/10/31 10:45:19 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: z8530tty.c,v 1.133 2019/07/21 16:10:37 rin Exp $"); #include "opt_kgdb.h" #include "opt_ntp.h" @@ -629,7 +629,9 @@ zsopen(dev_t dev, int flags, int mode, struct lwp *l) /* Make sure zsparam will see changes. */ tp->t_ospeed = 0; + mutex_spin_exit(&tty_lock); (void) zsparam(tp, &t); + mutex_spin_enter(&tty_lock); /* * Note: zsparam has done: cflag, ispeed, ospeed @@ -1672,9 +1674,7 @@ zstty_stsoft(struct zstty_softc *zst, struct tty *tp) /* * Inform the tty layer that carrier detect changed. */ - mutex_spin_exit(&tty_lock); (void) (*tp->t_linesw->l_modem)(tp, ISSET(rr0, ZSRR0_DCD)); - mutex_spin_enter(&tty_lock); } if (ISSET(delta, cs->cs_rr0_cts)) { |
