diff options
-rw-r--r-- | drivers/tty/n_tty.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index 2caa2936d1b1..c7f8f7bc1423 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -274,7 +274,8 @@ static void n_tty_check_unthrottle(struct tty_struct *tty) | |||
274 | return; | 274 | return; |
275 | n_tty_set_room(tty); | 275 | n_tty_set_room(tty); |
276 | n_tty_write_wakeup(tty->link); | 276 | n_tty_write_wakeup(tty->link); |
277 | wake_up_interruptible_poll(&tty->link->write_wait, POLLOUT); | 277 | if (waitqueue_active(&tty->link->write_wait)) |
278 | wake_up_interruptible_poll(&tty->link->write_wait, POLLOUT); | ||
278 | return; | 279 | return; |
279 | } | 280 | } |
280 | 281 | ||
@@ -349,7 +350,8 @@ static void n_tty_packet_mode_flush(struct tty_struct *tty) | |||
349 | spin_lock_irqsave(&tty->ctrl_lock, flags); | 350 | spin_lock_irqsave(&tty->ctrl_lock, flags); |
350 | if (tty->link->packet) { | 351 | if (tty->link->packet) { |
351 | tty->ctrl_status |= TIOCPKT_FLUSHREAD; | 352 | tty->ctrl_status |= TIOCPKT_FLUSHREAD; |
352 | wake_up_interruptible(&tty->link->read_wait); | 353 | if (waitqueue_active(&tty->link->read_wait)) |
354 | wake_up_interruptible(&tty->link->read_wait); | ||
353 | } | 355 | } |
354 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | 356 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); |
355 | } | 357 | } |
@@ -1155,7 +1157,8 @@ static void n_tty_receive_break(struct tty_struct *tty) | |||
1155 | put_tty_queue('\0', ldata); | 1157 | put_tty_queue('\0', ldata); |
1156 | } | 1158 | } |
1157 | put_tty_queue('\0', ldata); | 1159 | put_tty_queue('\0', ldata); |
1158 | wake_up_interruptible(&tty->read_wait); | 1160 | if (waitqueue_active(&tty->read_wait)) |
1161 | wake_up_interruptible(&tty->read_wait); | ||
1159 | } | 1162 | } |
1160 | 1163 | ||
1161 | /** | 1164 | /** |
@@ -1213,7 +1216,8 @@ static void n_tty_receive_parity_error(struct tty_struct *tty, unsigned char c) | |||
1213 | put_tty_queue('\0', ldata); | 1216 | put_tty_queue('\0', ldata); |
1214 | else | 1217 | else |
1215 | put_tty_queue(c, ldata); | 1218 | put_tty_queue(c, ldata); |
1216 | wake_up_interruptible(&tty->read_wait); | 1219 | if (waitqueue_active(&tty->read_wait)) |
1220 | wake_up_interruptible(&tty->read_wait); | ||
1217 | } | 1221 | } |
1218 | 1222 | ||
1219 | static void | 1223 | static void |
@@ -1802,8 +1806,10 @@ static void n_tty_set_termios(struct tty_struct *tty, struct ktermios *old) | |||
1802 | start_tty(tty); | 1806 | start_tty(tty); |
1803 | 1807 | ||
1804 | /* The termios change make the tty ready for I/O */ | 1808 | /* The termios change make the tty ready for I/O */ |
1805 | wake_up_interruptible(&tty->write_wait); | 1809 | if (waitqueue_active(&tty->write_wait)) |
1806 | wake_up_interruptible(&tty->read_wait); | 1810 | wake_up_interruptible(&tty->write_wait); |
1811 | if (waitqueue_active(&tty->read_wait)) | ||
1812 | wake_up_interruptible(&tty->read_wait); | ||
1807 | } | 1813 | } |
1808 | 1814 | ||
1809 | /** | 1815 | /** |