virtio_console: drop custom control queue cleanup
authorMichael S. Tsirkin <mst@redhat.com>
Fri, 20 Apr 2018 17:49:04 +0000 (20:49 +0300)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 25 Apr 2018 17:41:23 +0000 (20:41 +0300)
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>
drivers/char/virtio_console.c

index 26a66ffd943e6b3e9cbdd438696eb9c92c51c30c..2d87ce5551405353e6265ed5e2b6d9ae58955643 100644 (file)
@@ -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.
@@ -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);
 }
@@ -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);