Commit c4bef7cb authored by Peter Hurley's avatar Peter Hurley Committed by Ben Hutchings

tty: Fix GPF in flush_to_ldisc(), part 2

commit f33798de upstream.

commit 9ce119f3 ("tty: Fix GPF in flush_to_ldisc()") fixed a
GPF caused by a line discipline which does not define a receive_buf()
method.

However, the vt driver (and speakup driver also) pushes selection
data directly to the line discipline receive_buf() method via
tty_ldisc_receive_buf(). Fix the same problem in tty_ldisc_receive_buf().
Signed-off-by: default avatarPeter Hurley <peter@hurleysoftware.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
parent db9ac0f3
...@@ -569,7 +569,7 @@ static inline int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p, ...@@ -569,7 +569,7 @@ static inline int tty_ldisc_receive_buf(struct tty_ldisc *ld, unsigned char *p,
count = ld->ops->receive_buf2(ld->tty, p, f, count); count = ld->ops->receive_buf2(ld->tty, p, f, count);
else { else {
count = min_t(int, count, ld->tty->receive_room); count = min_t(int, count, ld->tty->receive_room);
if (count) if (count && ld->ops->receive_buf)
ld->ops->receive_buf(ld->tty, p, f, count); ld->ops->receive_buf(ld->tty, p, f, count);
} }
return count; return count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment