diff options
author | Dan Carpenter <error27@gmail.com> | 2006-12-13 00:35:09 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-13 09:05:53 -0800 |
commit | b3f13debd593dbd7242a4ecf6c9b4d529805e5a0 (patch) | |
tree | d37de63bd6809b14fe789195706b754f11de2254 /drivers/char | |
parent | a2db8dfce8d94fecae50128d912fec7980687a51 (diff) | |
download | kernel-crypto-b3f13debd593dbd7242a4ecf6c9b4d529805e5a0.tar.gz kernel-crypto-b3f13debd593dbd7242a4ecf6c9b4d529805e5a0.tar.xz kernel-crypto-b3f13debd593dbd7242a4ecf6c9b4d529805e5a0.zip |
[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: Dan Carpenter <error27@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tty_io.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index a928f6af52f..47a6eacb10b 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -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) 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); |