[PATCH v10 09/41] virtio_ring: split: introduce vring_free_split()

Xuan Zhuo xuanzhuo at linux.alibaba.com
Thu Jun 23 19:55:49 PDT 2022


Free the structure struct vring_vritqueue_split.

Subsequent patches require it.

Signed-off-by: Xuan Zhuo <xuanzhuo at linux.alibaba.com>
---
 drivers/virtio/virtio_ring.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index 7bc1eecff7fe..f39282555190 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -934,6 +934,16 @@ static void *virtqueue_detach_unused_buf_split(struct virtqueue *_vq)
 	return NULL;
 }
 
+static void vring_free_split(struct vring_virtqueue_split *vring,
+			     struct virtio_device *vdev)
+{
+	vring_free_queue(vdev, vring->queue_size_in_bytes, vring->vring.desc,
+			 vring->queue_dma_addr);
+
+	kfree(vring->desc_state);
+	kfree(vring->desc_extra);
+}
+
 static struct virtqueue *vring_create_virtqueue_split(
 	unsigned int index,
 	unsigned int num,
-- 
2.31.0




More information about the linux-um mailing list