aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/pty.c
diff options
context:
space:
mode:
authorPeter Hurley <peter@hurleysoftware.com>2014-10-16 15:33:28 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-05 19:34:36 -0500
commit4ed60fc257185dbb0daea7cd3e4289d1658b11f6 (patch)
tree45f256d65961d5b86d33946eda270d401521aab2 /drivers/tty/pty.c
parent2622d73e51acfe1dbeb21bf2299066bdead85163 (diff)
pty: Hold ctrl_lock for packet mode updates
Updates to the packet mode enable require holding the ctrl_lock; the serialization prevents corruption of adjacent fields. Signed-off-by: Peter Hurley <peter@hurleysoftware.com> Reviewed-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/pty.c')
-rw-r--r--drivers/tty/pty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index bcec4c71a408..7a1a53819e22 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -47,7 +47,9 @@ static void pty_close(struct tty_struct *tty, struct file *filp)
47 set_bit(TTY_IO_ERROR, &tty->flags); 47 set_bit(TTY_IO_ERROR, &tty->flags);
48 wake_up_interruptible(&tty->read_wait); 48 wake_up_interruptible(&tty->read_wait);
49 wake_up_interruptible(&tty->write_wait); 49 wake_up_interruptible(&tty->write_wait);
50 spin_lock_irq(&tty->ctrl_lock);
50 tty->packet = 0; 51 tty->packet = 0;
52 spin_unlock_irq(&tty->ctrl_lock);
51 /* Review - krefs on tty_link ?? */ 53 /* Review - krefs on tty_link ?? */
52 if (!tty->link) 54 if (!tty->link)
53 return; 55 return;