From 72c9d55b5ab131d46aa1f1fc2e8b1359bcb7a223 Mon Sep 17 00:00:00 2001 From: Paul Fulghum Date: Tue, 14 Feb 2006 13:53:00 -0800 Subject: [PATCH] --- yaml --- r: 20316 b: refs/heads/master c: da965822abd18a17d7cffe1d511f48951c82dfb6 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/char/tty_io.c | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 63c780eb8574..2b51d0bc5c70 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 16bf134840da3920ded1290973c56ec214636f12 +refs/heads/master: da965822abd18a17d7cffe1d511f48951c82dfb6 diff --git a/trunk/drivers/char/tty_io.c b/trunk/drivers/char/tty_io.c index a23816d3e9a1..e9bba94fc898 100644 --- a/trunk/drivers/char/tty_io.c +++ b/trunk/drivers/char/tty_io.c @@ -1841,7 +1841,6 @@ static void release_dev(struct file * filp) tty_closing = tty->count <= 1; o_tty_closing = o_tty && (o_tty->count <= (pty_master ? 1 : 0)); - up(&tty_sem); do_sleep = 0; if (tty_closing) { @@ -1869,6 +1868,7 @@ static void release_dev(struct file * filp) printk(KERN_WARNING "release_dev: %s: read/write wait queue " "active!\n", tty_name(tty, buf)); + up(&tty_sem); schedule(); } @@ -1877,8 +1877,6 @@ static void release_dev(struct file * filp) * both sides, and we've completed the last operation that could * block, so it's safe to proceed with closing. */ - - down(&tty_sem); if (pty_master) { if (--o_tty->count < 0) { printk(KERN_WARNING "release_dev: bad pty slave count " @@ -1892,7 +1890,6 @@ static void release_dev(struct file * filp) tty->count, tty_name(tty, buf)); tty->count = 0; } - up(&tty_sem); /* * We've decremented tty->count, so we need to remove this file @@ -1937,6 +1934,8 @@ static void release_dev(struct file * filp) read_unlock(&tasklist_lock); } + up(&tty_sem); + /* check whether both sides are closing ... */ if (!tty_closing || (o_tty && !o_tty_closing)) return;