Skip to content

Commit

Permalink
virtio_console: drop custom control queue cleanup
Browse files Browse the repository at this point in the history
We now cleanup all VQs on device removal - no need
to handle the control VQ specially.

Cc: stable@vger.kernel.org
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
  • Loading branch information
Michael S. Tsirkin committed Apr 25, 2018
1 parent a7a69ec commit 61a8950
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions drivers/char/virtio_console.c
Original file line number Diff line number Diff line change
Expand Up @@ -1988,21 +1988,6 @@ static void remove_vqs(struct ports_device *portdev)
kfree(portdev->out_vqs);
}

static void remove_controlq_data(struct ports_device *portdev)
{
struct port_buffer *buf;
unsigned int len;

if (!use_multiport(portdev))
return;

while ((buf = virtqueue_get_buf(portdev->c_ivq, &len)))
free_buf(buf, true);

while ((buf = virtqueue_detach_unused_buf(portdev->c_ivq)))
free_buf(buf, true);
}

/*
* Once we're further in boot, we get probed like any other virtio
* device.
Expand Down Expand Up @@ -2163,7 +2148,6 @@ static void virtcons_remove(struct virtio_device *vdev)
* have to just stop using the port, as the vqs are going
* away.
*/
remove_controlq_data(portdev);
remove_vqs(portdev);
kfree(portdev);
}
Expand Down Expand Up @@ -2208,7 +2192,6 @@ static int virtcons_freeze(struct virtio_device *vdev)
*/
if (use_multiport(portdev))
virtqueue_disable_cb(portdev->c_ivq);
remove_controlq_data(portdev);

list_for_each_entry(port, &portdev->ports, list) {
virtqueue_disable_cb(port->in_vq);
Expand Down

0 comments on commit 61a8950

Please sign in to comment.