From: sjur.brandeland@stericsson.com Date: Fri, 16 Nov 2012 00:50:19 +0000 (+1030) Subject: virtio_console: Free buffers from out-queue upon close X-Git-Tag: v3.8-rc1~28^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=eb34f12b509823571e88b791ae2088280943894f;p=profile%2Fivi%2Fkernel-adaptation-intel-automotive.git virtio_console: Free buffers from out-queue upon close Free pending output buffers from the virtio out-queue when host has acknowledged port_close. Signed-off-by: Sjur Brændeland Signed-off-by: Rusty Russell (rebased & cut down) --- diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index eecb1f9..db244b5 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c @@ -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); } /*