diff --git a/[refs] b/[refs] index eddca7950f97..7bc3338647cb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ce072a0cee420782ed0a079ac17c7ca26056fb95 +refs/heads/master: 2d24cdaa6e389f85dad51eda39f1c2684a4f15b0 diff --git a/trunk/drivers/char/virtio_console.c b/trunk/drivers/char/virtio_console.c index 0538425e9a71..105181c1e6be 100644 --- a/trunk/drivers/char/virtio_console.c +++ b/trunk/drivers/char/virtio_console.c @@ -386,28 +386,23 @@ static int add_inbuf(struct virtqueue *vq, struct port_buffer *buf) static void discard_port_data(struct port *port) { struct port_buffer *buf; - struct virtqueue *vq; - unsigned int len, err; + unsigned int err; if (!port->portdev) { /* Device has been unplugged. vqs are already gone. */ return; } - vq = port->in_vq; - if (port->inbuf) - buf = port->inbuf; - else - buf = virtqueue_get_buf(vq, &len); + buf = get_inbuf(port); err = 0; while (buf) { - if (add_inbuf(vq, buf) < 0) { + if (add_inbuf(port->in_vq, buf) < 0) { err++; free_buf(buf); } - buf = virtqueue_get_buf(vq, &len); + port->inbuf = NULL; + buf = get_inbuf(port); } - port->inbuf = NULL; if (err) dev_warn(port->dev, "Errors adding %d buffers back to vq\n", err);