diff --git a/[refs] b/[refs] index 1af4bf3c63ea..1ebd58bc9fb3 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eaeff9608a8cf43a676b6f4b6235ea9d76192230 +refs/heads/master: 6dc69f970231387d8fe646a831920da26408b5f5 diff --git a/trunk/drivers/char/virtio_console.c b/trunk/drivers/char/virtio_console.c index f63bf77a4825..11a9573f901e 100644 --- a/trunk/drivers/char/virtio_console.c +++ b/trunk/drivers/char/virtio_console.c @@ -653,7 +653,7 @@ static int put_chars(u32 vtermno, const char *buf, int count) port = find_port_by_vtermno(vtermno); if (!port) - return 0; + return -EPIPE; return send_buf(port, (void *)buf, count); } @@ -669,9 +669,13 @@ static int get_chars(u32 vtermno, char *buf, int count) { struct port *port; + /* If we've not set up the port yet, we have no input to give. */ + if (unlikely(early_put_chars)) + return 0; + port = find_port_by_vtermno(vtermno); if (!port) - return 0; + return -EPIPE; /* If we don't have an input queue yet, we can't get input. */ BUG_ON(!port->in_vq);