From 0873575a038226b00ef9d5fbda5375dac9b48f27 Mon Sep 17 00:00:00 2001 From: Zhao Yakui Date: Thu, 21 Apr 2022 15:46:51 +0800 Subject: [PATCH] ACRN:DM:VGPU: Free the memory after creating udmabuf In course of creating the udmabuf, udmabuf_create_list is allocated and passed to kernel. After the dmabuf is returned, it is not used any more. Need to free it otherwises it will cause the memory leak. Tracked-On: #7337 Acked-by: Wang Yu Signed-off-by: Zhao Yakui --- devicemodel/hw/pci/virtio/virtio_gpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/devicemodel/hw/pci/virtio/virtio_gpu.c b/devicemodel/hw/pci/virtio/virtio_gpu.c index dedde9dd9..fde11fe1c 100644 --- a/devicemodel/hw/pci/virtio/virtio_gpu.c +++ b/devicemodel/hw/pci/virtio/virtio_gpu.c @@ -1026,6 +1026,7 @@ static struct dma_buf_info *virtio_gpu_create_udmabuf(struct virtio_gpu *gpu, info->dmabuf_fd = dmabuf_fd; atomic_store(&info->ref_count, 1); } + free(list); return info; }