diff options
-rw-r--r-- | drivers/char/virtio_console.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 92f1f65d57a9..47b710ca4ab3 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -663,6 +663,10 @@ static unsigned int port_fops_poll(struct file *filp, poll_table *wait) | |||
663 | port = filp->private_data; | 663 | port = filp->private_data; |
664 | poll_wait(filp, &port->waitqueue, wait); | 664 | poll_wait(filp, &port->waitqueue, wait); |
665 | 665 | ||
666 | if (!port->guest_connected) { | ||
667 | /* Port got unplugged */ | ||
668 | return POLLHUP; | ||
669 | } | ||
666 | ret = 0; | 670 | ret = 0; |
667 | if (!will_read_block(port)) | 671 | if (!will_read_block(port)) |
668 | ret |= POLLIN | POLLRDNORM; | 672 | ret |= POLLIN | POLLRDNORM; |