diff options
| author | Peter Hurley <peter@hurleysoftware.com> | 2013-06-15 09:36:10 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-07-23 19:47:09 -0400 |
| commit | e9975fdec0138f1b2a85b9624e41660abd9865d4 (patch) | |
| tree | 6c90bac37cfe6843b4e78cb9280aa10524da351d /include | |
| parent | e8437d7ecbc50198705331449367d401ebb3181f (diff) | |
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 'include')
| -rw-r--r-- | include/linux/tty.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/tty.h b/include/linux/tty.h index 7c124541f011..1c8fef0e3ff6 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -66,7 +66,7 @@ static inline char *flag_buf_ptr(struct tty_buffer *b, int ofs) | |||
| 66 | 66 | ||
| 67 | struct tty_bufhead { | 67 | struct tty_bufhead { |
| 68 | struct work_struct work; | 68 | struct work_struct work; |
| 69 | spinlock_t lock; | 69 | struct mutex flush_mutex; |
| 70 | struct tty_buffer sentinel; | 70 | struct tty_buffer sentinel; |
| 71 | struct tty_buffer *head; /* Queue head */ | 71 | struct tty_buffer *head; /* Queue head */ |
| 72 | struct tty_buffer *tail; /* Active buffer */ | 72 | struct tty_buffer *tail; /* Active buffer */ |
