public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: dcarpenter <error27@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [patch] tty_io.c balance tty_ldisc_ref()
Date: Sun, 10 Dec 2006 12:56:55 -0800	[thread overview]
Message-ID: <20061210205655.GA4062@localhost.localdomain> (raw)

tty_ldisc_deref() should only be called when 
tty_ldisc_ref() succeeds otherwise it triggers a BUG().
There's already a function tty_ldisc_flush() that flushes
properly.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c
index 4044c86..bf6699b 100644
--- a/drivers/char/tty_io.c
+++ b/drivers/char/tty_io.c
@@ -3335,18 +3335,13 @@ #else
 	int session;
 	int		i;
 	struct file	*filp;
-	struct tty_ldisc *disc;
 	struct fdtable *fdt;
 	
 	if (!tty)
 		return;
 	session = tty->session;
 	
-	/* We don't want an ldisc switch during this */
-	disc = tty_ldisc_ref(tty);
-	if (disc && disc->flush_buffer)
-		disc->flush_buffer(tty);
-	tty_ldisc_deref(disc);
+	tty_ldisc_flush(tty);
 
 	if (tty->driver->flush_buffer)
 		tty->driver->flush_buffer(tty);

             reply	other threads:[~2006-12-10 20:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-10 20:56 dcarpenter [this message]
2006-12-10 21:26 ` [patch] tty_io.c balance tty_ldisc_ref() Alan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061210205655.GA4062@localhost.localdomain \
    --to=error27@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox