tty_io.c balance tty_ldisc_ref()
PATCH 1/1 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 properly.
Signed-off-by Dan Carpenter <[email protected]>
drivers/char/tty_io.c +1 -6
@@ -3335,18 +3335,13 @@ #elseint 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);
Quoted 4 lines · On Sun, 10 Dec 2006 12:56:55 -0800 dcarpenter <[email protected]> wrote:
tty_ldisc_deref()should only be called whentty_ldisc_ref()succeeds otherwise it triggers aBUG(). There's already a functiontty_ldisc_flush()that flushes properly.
Well spotted and nicely fixed.
Quoted 2 lines
Signed-off-by Dan Carpenter <[email protected]>
Acked-by Alan Cox <[email protected]>