diff options
author | tanimura <tanimura@FreeBSD.org> | 2002-03-02 12:42:24 +0000 |
---|---|---|
committer | tanimura <tanimura@FreeBSD.org> | 2002-03-02 12:42:24 +0000 |
commit | af34f116bc52bfaa9cd07915847be4f81f91c2a4 (patch) | |
tree | d36ebe908ecc33ea638c4e19012e31d78285633f /sys/kern/tty.c | |
parent | 3dccea70aff18dfe9a7c2002330318c88a3e84d8 (diff) | |
download | FreeBSD-src-af34f116bc52bfaa9cd07915847be4f81f91c2a4.zip FreeBSD-src-af34f116bc52bfaa9cd07915847be4f81f91c2a4.tar.gz |
Fix lock leakage and late unlock.
Submitted by: bde
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 0069b17..1d5ecdb 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -780,14 +780,14 @@ ttioctl(tp, cmd, data, flag) } PROC_UNLOCK(p); PGRP_LOCK(p->p_pgrp); + PGRPSESS_SUNLOCK(); pgsignal(p->p_pgrp, SIGTTOU, 1); PGRP_UNLOCK(p->p_pgrp); error = ttysleep(tp, &lbolt, TTOPRI | PCATCH, "ttybg1", 0); - if (error) { - PGRPSESS_SUNLOCK(); + if (error) return (error); - } + PGRPSESS_SLOCK(); PROC_LOCK(p); } PROC_UNLOCK(p); |