[lkml]   [2006]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[patch] tty_io.c balance tty_ldisc_ref()
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

Signed-off-by: Dan Carpenter <>

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)
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)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2006-12-10 21:59    [W:0.038 / U:1.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site