From 868ce2c64e9c1c446bb853c68c6f2b772ec5b2be Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 15 Jun 2009 16:27:29 +0100 Subject: [PATCH] --- yaml --- r: 150988 b: refs/heads/master c: cbcb6d66af4c6169ce1c2d01a3ab345f04b8359d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/char/pty.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index 095bb9ff4bc7..e7136eb263c1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b231125af7811a2f68c455d3bda95ac170ee4fa6 +refs/heads/master: cbcb6d66af4c6169ce1c2d01a3ab345f04b8359d diff --git a/trunk/drivers/char/pty.c b/trunk/drivers/char/pty.c index 5acd29e6e043..3910ce112a95 100644 --- a/trunk/drivers/char/pty.c +++ b/trunk/drivers/char/pty.c @@ -104,7 +104,7 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, struct tty_struct *to = tty->link; int c; - if (!to || tty->stopped) + if (!to || !to->ldisc || tty->stopped) return 0; c = to->receive_room; @@ -148,7 +148,7 @@ static int pty_chars_in_buffer(struct tty_struct *tty) int count; /* We should get the line discipline lock for "tty->link" */ - if (!to || !to->ldisc->ops->chars_in_buffer) + if (!to || !to->ldisc || !to->ldisc->ops->chars_in_buffer) return 0; /* The ldisc must report 0 if no characters available to be read */ @@ -183,7 +183,7 @@ static void pty_flush_buffer(struct tty_struct *tty) struct tty_struct *to = tty->link; unsigned long flags; - if (!to) + if (!to || !to->ldisc) return; if (to->ldisc->ops->flush_buffer)