Commit b3f13deb authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds

[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 properly.
Signed-off-by: default avatarDan Carpenter <>
Acked-by: default avatarAlan Cox <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent a2db8dfc
......@@ -3335,18 +3335,13 @@ static void __do_SAK(struct work_struct *work)
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)
if (tty->driver->flush_buffer)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment