summaryrefslogtreecommitdiff
path: root/drivers/virtio
diff options
context:
space:
mode:
authorXuan Zhuo <xuanzhuo@linux.alibaba.com>2022-08-01 09:38:29 +0300
committerMichael S. Tsirkin <mst@redhat.com>2022-08-11 11:06:39 +0300
commit89f05d94a33abec2d38f644065ca5cff5f50c4d7 (patch)
tree955a94849154d6ee9eaf72d38a093907d5e7991c /drivers/virtio
parentcd4c812acb8390a3cfa0a178b777979f9cdd3eeb (diff)
downloadlinux-89f05d94a33abec2d38f644065ca5cff5f50c4d7.tar.xz
virtio_ring: split: introduce vring_free_split()
Free the structure struct vring_vritqueue_split. Subsequent patches require it. Signed-off-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Acked-by: Jason Wang <jasowang@redhat.com> Message-Id: <20220801063902.129329-10-xuanzhuo@linux.alibaba.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'drivers/virtio')
-rw-r--r--drivers/virtio/virtio_ring.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 1d51ed46b295..71cc7762ec51 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -937,6 +937,17 @@ static void *virtqueue_detach_unused_buf_split(struct virtqueue *_vq)
return NULL;
}
+static void vring_free_split(struct vring_virtqueue_split *vring_split,
+ struct virtio_device *vdev)
+{
+ vring_free_queue(vdev, vring_split->queue_size_in_bytes,
+ vring_split->vring.desc,
+ vring_split->queue_dma_addr);
+
+ kfree(vring_split->desc_state);
+ kfree(vring_split->desc_extra);
+}
+
static struct virtqueue *vring_create_virtqueue_split(
unsigned int index,
unsigned int num,