diff options
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r-- | drivers/tty/n_tty.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 41fe8a047d37..fe9d129c8735 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -2353,8 +2353,12 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, | |||
2353 | if (tty->ops->flush_chars) | 2353 | if (tty->ops->flush_chars) |
2354 | tty->ops->flush_chars(tty); | 2354 | tty->ops->flush_chars(tty); |
2355 | } else { | 2355 | } else { |
2356 | struct n_tty_data *ldata = tty->disc_data; | ||
2357 | |||
2356 | while (nr > 0) { | 2358 | while (nr > 0) { |
2359 | mutex_lock(&ldata->output_lock); | ||
2357 | c = tty->ops->write(tty, b, nr); | 2360 | c = tty->ops->write(tty, b, nr); |
2361 | mutex_unlock(&ldata->output_lock); | ||
2358 | if (c < 0) { | 2362 | if (c < 0) { |
2359 | retval = c; | 2363 | retval = c; |
2360 | goto break_out; | 2364 | goto break_out; |