mirror of
https://github.com/joel16/android_kernel_sony_msm8994_rework.git
synced 2024-11-24 20:39:48 +00:00
[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>
This commit is contained in:
parent
a2db8dfce8
commit
b3f13debd5
@ -3335,18 +3335,13 @@ static void __do_SAK(struct work_struct *work)
|
|||||||
int session;
|
int session;
|
||||||
int i;
|
int i;
|
||||||
struct file *filp;
|
struct file *filp;
|
||||||
struct tty_ldisc *disc;
|
|
||||||
struct fdtable *fdt;
|
struct fdtable *fdt;
|
||||||
|
|
||||||
if (!tty)
|
if (!tty)
|
||||||
return;
|
return;
|
||||||
session = tty->session;
|
session = tty->session;
|
||||||
|
|
||||||
/* We don't want an ldisc switch during this */
|
tty_ldisc_flush(tty);
|
||||||
disc = tty_ldisc_ref(tty);
|
|
||||||
if (disc && disc->flush_buffer)
|
|
||||||
disc->flush_buffer(tty);
|
|
||||||
tty_ldisc_deref(disc);
|
|
||||||
|
|
||||||
if (tty->driver->flush_buffer)
|
if (tty->driver->flush_buffer)
|
||||||
tty->driver->flush_buffer(tty);
|
tty->driver->flush_buffer(tty);
|
||||||
|
Loading…
Reference in New Issue
Block a user