Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 285a8344 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "n_tty: Fix n_tty_write crash when echoing in raw mode"

parents 6d60e4d6 91899288
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2066,8 +2066,12 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file,
			if (tty->ops->flush_chars)
				tty->ops->flush_chars(tty);
		} else {
			struct n_tty_data *ldata = tty->disc_data;

			while (nr > 0) {
				mutex_lock(&ldata->output_lock);
				c = tty->ops->write(tty, b, nr);
				mutex_unlock(&ldata->output_lock);
				if (c < 0) {
					retval = c;
					goto break_out;