tty: Handle problem if line discipline does not have receive_buf
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Jan 2019 09:46:58 +0000 (10:46 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jan 2019 07:14:36 +0000 (08:14 +0100)
commit80250b48803ab0aa3eb8e0d798a4742b26ef84d9
treee7b1f44b1689065bbaa2405f454d7b9b0d7a594f
parent3209eeded8635c8a96781f2dd362d460682a1cec
tty: Handle problem if line discipline does not have receive_buf

commit 27cfb3a53be46a54ec5e0bd04e51995b74c90343 upstream.

Some tty line disciplines do not have a receive buf callback, so
properly check for that before calling it.  If they do not have this
callback, just eat the character quietly, as we can't fail this call.

Reported-by: Jann Horn <jannh@google.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/tty_io.c