]> git.neil.brown.name Git - history.git/commitdiff
Fix bogus opost buffer size check
authorLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 15 Feb 2005 04:59:34 +0000 (20:59 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 15 Feb 2005 04:59:34 +0000 (20:59 -0800)
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.

drivers/char/n_tty.c

index ade7ceb51039b08cba86cefa3125cae768ce1f6c..ae09412cc31796c14e4fba3935f1ac9e6fe8ff7d 100644 (file)
@@ -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) {