All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Hurley <peter@hurleysoftware.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Jiri Slaby <jslaby@suse.cz>,
	linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Peter Hurley <peter@hurleysoftware.com>,
	stable@vger.kernel.org
Subject: [PATCH 5/9] tty: Fix GPF in flush_to_ldisc(), part 2
Date: Sun, 10 Jan 2016 14:43:05 -0800	[thread overview]
Message-ID: <1452465789-4039-5-git-send-email-peter@hurleysoftware.com> (raw)
In-Reply-To: <1452465789-4039-1-git-send-email-peter@hurleysoftware.com>

commit 9ce119f318ba ("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().

Cc: <stable@vger.kernel.org>
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
---
 include/linux/tty.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/tty.h b/include/linux/tty.h
index dea7d54..03e4015 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -579,7 +579,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);
 	else {
 		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);
 	}
 	return count;
-- 
2.7.0

  parent reply	other threads:[~2016-01-10 22:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-10 22:43 [PATCH 1/9] tty: rocket: Remove private close_wait Peter Hurley
2016-01-10 22:43 ` [PATCH 2/9] n_tty: Ignore all read data when closing Peter Hurley
2016-01-10 22:43 ` [PATCH 3/9] ia64: Pin controlling tty for unaligned fault message Peter Hurley
2016-01-10 22:43 ` [PATCH 4/9] staging: dgap: Remove redundant write_wait wakeups Peter Hurley
2016-01-10 22:43 ` Peter Hurley [this message]
2016-01-10 22:43 ` [PATCH 6/9] tty: Unify receive_buf() code paths Peter Hurley
2016-01-10 22:43 ` [PATCH 7/9] tty: Allow unreadable mess to be > 80 chars Peter Hurley
2016-01-10 22:43 ` [PATCH 8/9] tty: Use termios c_*flag macros Peter Hurley
2016-01-10 22:43 ` [PATCH 9/9] tty: Use test_bit() with tty->flags Peter Hurley
2016-01-11  4:37 ` [PATCH 1/9] tty: rocket: Remove private close_wait Peter Hurley
     [not found] <1452465935-4151-1-git-send-email-peter@hurleysoftware.com>
2016-01-10 22:45 ` [PATCH 5/9] tty: Fix GPF in flush_to_ldisc(), part 2 Peter Hurley

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1452465789-4039-5-git-send-email-peter@hurleysoftware.com \
    --to=peter@hurleysoftware.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.