diff options
| -rw-r--r-- | drivers/tty/n_tty.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index d8a779d3a611..c222a561c5ac 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
| @@ -1998,7 +1998,10 @@ static int canon_copy_from_read_buf(struct tty_struct *tty, | |||
| 1998 | found = 1; | 1998 | found = 1; |
| 1999 | 1999 | ||
| 2000 | size = N_TTY_BUF_SIZE - tail; | 2000 | size = N_TTY_BUF_SIZE - tail; |
| 2001 | n = (found + eol + size) & (N_TTY_BUF_SIZE - 1); | 2001 | n = eol - tail; |
| 2002 | if (n > 4096) | ||
| 2003 | n += 4096; | ||
| 2004 | n += found; | ||
| 2002 | c = n; | 2005 | c = n; |
| 2003 | 2006 | ||
| 2004 | if (found && read_buf(ldata, eol) == __DISABLED_CHAR) { | 2007 | if (found && read_buf(ldata, eol) == __DISABLED_CHAR) { |
