Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2014-05-05 10:24:08 +0200
committerJiri Kosina <jkosina@suse.cz>2014-05-13 10:40:57 +0200
commit6fd55f57dfb52d444da0005f110312db7f451fab (patch)
treef90ce30c961cb4d72deeec1b44f11c92e0999ad8
parentf853117b23eb19e18439e3e891e3551e0a8ab33d (diff)
n_tty: Fix n_tty_write crash when echoing in raw moderpm-3.0.101-0.29
-rw-r--r--drivers/tty/n_tty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 5a052aa16391..0ad920b416c2 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2008,7 +2008,9 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
tty->ops->flush_chars(tty);
} else {
while (nr > 0) {
+ mutex_lock(&tty->output_lock);
c = tty->ops->write(tty, b, nr);
+ mutex_unlock(&tty->output_lock);
if (c < 0) {
retval = c;
goto break_out;