Skip to content

Commit

Permalink
virtio_console: Free buffers from out-queue upon close
Browse files Browse the repository at this point in the history
Free pending output buffers from the virtio out-queue when
host has acknowledged port_close.

Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (rebased & cut down)
  • Loading branch information
sjur.brandeland@stericsson.com authored and Rusty Russell committed Dec 18, 2012
1 parent 800ba5e commit eb34f12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,10 @@ static void remove_port_data(struct port *port)
/* Remove buffers we queued up for the Host to send us data in. */
while ((buf = virtqueue_detach_unused_buf(port->in_vq)))
free_buf(buf);

/* Free pending buffers from the out-queue. */
while ((buf = virtqueue_detach_unused_buf(port->out_vq)))
free_buf(buf);
}

/*
Expand Down

0 comments on commit eb34f12

Please sign in to comment.