We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 638a6f4 commit b6da31bCopy full SHA for b6da31b
drivers/tty/pty.c
@@ -110,16 +110,19 @@ static void pty_unthrottle(struct tty_struct *tty)
110
static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
111
{
112
struct tty_struct *to = tty->link;
113
+ unsigned long flags;
114
115
if (tty->stopped)
116
return 0;
117
118
if (c > 0) {
119
+ spin_lock_irqsave(&to->port->lock, flags);
120
/* Stuff the data into the input queue of the other end */
121
c = tty_insert_flip_string(to->port, buf, c);
122
/* And shovel */
123
if (c)
124
tty_flip_buffer_push(to->port);
125
+ spin_unlock_irqrestore(&to->port->lock, flags);
126
}
127
return c;
128
0 commit comments