From: Linus Torvalds Date: Tue, 15 Feb 2005 04:59:34 +0000 (-0800) Subject: Fix bogus opost buffer size check X-Git-Tag: v2.6.11-rc5~8^2~39^2~3 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=e6d7bb28b556f3a2c50fc8def9ef7b49e7cc694f;p=history.git Fix bogus opost buffer size check Noted while going through the n_tty code: that buffer check used to check against the size of the temporary kernel buffer, but since the tty layer was changed to use kernel buffers though-out, the kernel buffer array became just a pointer, and the check was limiting the opost blocksize to the size of a pointer, which makes no sense. Just remove it, since now the whole buffer is always in kernel space. --- diff --git a/drivers/char/n_tty.c b/drivers/char/n_tty.c index ade7ceb51039..ae09412cc317 100644 --- a/drivers/char/n_tty.c +++ b/drivers/char/n_tty.c @@ -317,8 +317,6 @@ static ssize_t opost_block(struct tty_struct * tty, return 0; if (nr > space) nr = space; - if (nr > sizeof(buf)) - nr = sizeof(buf); for (i = 0, cp = buf; i < nr; i++, cp++) { switch (*cp) {