Skip to contentSkip to conversation

drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl()

PATCH In review hexin 2 participants 2 messages Jul 20, 2020

Subsystems (5)
lore
Share & tools
lore

hexin

author
#0 lore raw

PATCH v2 1/1 drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl()

commit 2cd7b6f08bc4 ("drm/virtio: add in/out fence support for explicit synchronization") deleted dma_fence_put(), which will cause the memory leak. To balance the reference count initialized when allocating fence, dma_fence_put() should not be deleted.

Fixes 2cd7b6f08bc4 ("drm/virtio: add in/out fence support for explicit synchronization")
---
 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/virtio/virtgpu_ioctl.c +1 -0
index 5df722072ba0..19c5bc01eb79 100644
@@ -179,6 +179,7 @@ static int virtio_gpu_execbuffer_ioctl(struct drm_device *dev, void *data,
 
 	virtio_gpu_cmd_submit(vgdev, buf, exbuf->size,
 			      vfpriv->ctx_id, buflist, out_fence);
+	dma_fence_put(&out_fence->f);
 	virtio_gpu_notify(vgdev);
 	return 0;
 
Signature · 1 line
2.21.1 (Apple Git-122.3)
#1 lore raw

Re: [PATCH v2] drm/virtio: Fix memory leak in virtio_gpu_execbuffer_ioctl()

Quoted 3 lines

… To balance the reference
count initialized when allocating fence, dma_fence_put() should not be deleted.

* Would an imperative wording be more appropriate for the change description?

* Is the information “hexin” sufficient for a real name?

Regards,
Markus