diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-21 17:45:38 +0100 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-01-21 17:45:38 +0100 |
| commit | ea3e160ff061f5b69962585744cac9df6557ce51 (patch) | |
| tree | ccdf32bff5dddfc031c6cadfe836239b94f5b1c2 /0008-tty-Handle-problem-if-line-discipline-does-not-have-.patch | |
| parent | a47b7cd1ae58ea0b41b69de496d6940a43b870df (diff) | |
| download | patches-ea3e160ff061f5b69962585744cac9df6557ce51.tar.gz | |
more patches
Diffstat (limited to '0008-tty-Handle-problem-if-line-discipline-does-not-have-.patch')
| -rw-r--r-- | 0008-tty-Handle-problem-if-line-discipline-does-not-have-.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/0008-tty-Handle-problem-if-line-discipline-does-not-have-.patch b/0008-tty-Handle-problem-if-line-discipline-does-not-have-.patch new file mode 100644 index 00000000000000..acd33e2ef78951 --- /dev/null +++ b/0008-tty-Handle-problem-if-line-discipline-does-not-have-.patch @@ -0,0 +1,29 @@ +From 19e08b371b6795e009f09cdcf30f76ad0f1db037 Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Date: Sun, 20 Jan 2019 10:46:58 +0100 +Subject: [PATCH 08/11] tty: Handle problem if line discipline does not have + receive_buf + +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 | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/tty/tty_io.c ++++ b/drivers/tty/tty_io.c +@@ -2189,7 +2189,8 @@ static int tiocsti(struct tty_struct *tt + ld = tty_ldisc_ref_wait(tty); + if (!ld) + return -EIO; +- ld->ops->receive_buf(tty, &ch, &mbz, 1); ++ if (ld->ops->receive_buf) ++ ld->ops->receive_buf(tty, &ch, &mbz, 1); + tty_ldisc_deref(ld); + return 0; + } |
