summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2013-06-15 15:36:10 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-07-24 01:47:09 +0200
commite9975fdec0138f1b2a85b9624e41660abd9865d4 (patch)
tree6c90bac37cfe6843b4e78cb9280aa10524da351d /drivers/staging
parenttty: Make driver-side flip buffers lockless (diff)
downloadlinux-e9975fdec0138f1b2a85b9624e41660abd9865d4.tar.xz
linux-e9975fdec0138f1b2a85b9624e41660abd9865d4.zip
tty: Ensure single-threaded flip buffer consumer with mutex
The buffer work may race with parallel tty_buffer_flush. Use a mutex to guarantee exclusive modify access to the head flip buffer. Remove the unneeded spin lock. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/dgrp/dgrp_tty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/dgrp/dgrp_tty.c b/drivers/staging/dgrp/dgrp_tty.c
index 654f6010b473..0d52de3729c6 100644
--- a/drivers/staging/dgrp/dgrp_tty.c
+++ b/drivers/staging/dgrp/dgrp_tty.c
@@ -1120,7 +1120,9 @@ static void dgrp_tty_close(struct tty_struct *tty, struct file *file)
if (!sent_printer_offstr)
dgrp_tty_flush_buffer(tty);
+ spin_unlock_irqrestore(&nd->nd_lock, lock_flags);
tty_ldisc_flush(tty);
+ spin_lock_irqsave(&nd->nd_lock, lock_flags);
break;
}