diff options
Diffstat (limited to 'drivers/char/pty.c')
-rw-r--r-- | drivers/char/pty.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/pty.c b/drivers/char/pty.c index 5acd29e6e043..3910ce112a95 100644 --- a/drivers/char/pty.c +++ b/drivers/char/pty.c | |||
@@ -104,7 +104,7 @@ static int pty_write(struct tty_struct *tty, const unsigned char *buf, | |||
104 | struct tty_struct *to = tty->link; | 104 | struct tty_struct *to = tty->link; |
105 | int c; | 105 | int c; |
106 | 106 | ||
107 | if (!to || tty->stopped) | 107 | if (!to || !to->ldisc || tty->stopped) |
108 | return 0; | 108 | return 0; |
109 | 109 | ||
110 | c = to->receive_room; | 110 | c = to->receive_room; |
@@ -148,7 +148,7 @@ static int pty_chars_in_buffer(struct tty_struct *tty) | |||
148 | int count; | 148 | int count; |
149 | 149 | ||
150 | /* We should get the line discipline lock for "tty->link" */ | 150 | /* We should get the line discipline lock for "tty->link" */ |
151 | if (!to || !to->ldisc->ops->chars_in_buffer) | 151 | if (!to || !to->ldisc || !to->ldisc->ops->chars_in_buffer) |
152 | return 0; | 152 | return 0; |
153 | 153 | ||
154 | /* The ldisc must report 0 if no characters available to be read */ | 154 | /* 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) | |||
183 | struct tty_struct *to = tty->link; | 183 | struct tty_struct *to = tty->link; |
184 | unsigned long flags; | 184 | unsigned long flags; |
185 | 185 | ||
186 | if (!to) | 186 | if (!to || !to->ldisc) |
187 | return; | 187 | return; |
188 | 188 | ||
189 | if (to->ldisc->ops->flush_buffer) | 189 | if (to->ldisc->ops->flush_buffer) |