Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 273212
b: refs/heads/master
c: 2d24cda
h: refs/heads/master
v: v3
  • Loading branch information
Amit Shah authored and Rusty Russell committed Nov 2, 2011
1 parent 1147be4 commit ff2683c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ce072a0cee420782ed0a079ac17c7ca26056fb95
refs/heads/master: 2d24cdaa6e389f85dad51eda39f1c2684a4f15b0
15 changes: 5 additions & 10 deletions trunk/drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ff2683c

Please sign in to comment.