|
@@ -110,16 +110,19 @@ static void pty_unthrottle(struct tty_struct *tty)
|
|
static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
|
|
static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c)
|
|
{
|
|
{
|
|
struct tty_struct *to = tty->link;
|
|
struct tty_struct *to = tty->link;
|
|
|
|
+ unsigned long flags;
|
|
|
|
|
|
if (tty->stopped)
|
|
if (tty->stopped)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
if (c > 0) {
|
|
if (c > 0) {
|
|
|
|
+ spin_lock_irqsave(&to->port->lock, flags);
|
|
/* Stuff the data into the input queue of the other end */
|
|
/* Stuff the data into the input queue of the other end */
|
|
c = tty_insert_flip_string(to->port, buf, c);
|
|
c = tty_insert_flip_string(to->port, buf, c);
|
|
/* And shovel */
|
|
/* And shovel */
|
|
if (c)
|
|
if (c)
|
|
tty_flip_buffer_push(to->port);
|
|
tty_flip_buffer_push(to->port);
|
|
|
|
+ spin_unlock_irqrestore(&to->port->lock, flags);
|
|
}
|
|
}
|
|
return c;
|
|
return c;
|
|
}
|
|
}
|