diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index 026ea6c27e07df30a9e777c0f43a70f3258af4b6..48306bc733f7d11f7d60c92dc633af95e236d60f 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -646,13 +646,13 @@ static int put_chars(u32 vtermno, const char *buf, int count) { struct port *port; + if (unlikely(early_put_chars)) + return early_put_chars(vtermno, buf, count); + port = find_port_by_vtermno(vtermno); if (!port) return 0; - if (unlikely(early_put_chars)) - return early_put_chars(vtermno, buf, count); - return send_buf(port, (void *)buf, count); }