* [PATCH v2] drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl()
@ 2020-07-20 14:44 hexin
2020-07-20 15:29 ` [PATCH v2] drm/virtio: Fix " Markus Elfring
0 siblings, 1 reply; 2+ messages in thread
From: hexin @ 2020-07-20 14:44 UTC (permalink / raw)
To: dri-devel, virtualization, linux-media, linaro-mm-sig,
christian.koenig, daniel, airlied, kraxel, Markus.Elfring,
sumit.semwal
Cc: linux-kernel, hexin, Liu Qi
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")
Signed-off-by: Liu Qi <liuqi.16@bytedance.com>
Signed-off-by: hexin <hexin.op@bytedance.com>
---
drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
index 5df722072ba0..19c5bc01eb79 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c
@@ -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;
--
2.21.1 (Apple Git-122.3)
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] drm/virtio: Fix memory leak in virtio_gpu_execbuffer_ioctl()
2020-07-20 14:44 [PATCH v2] drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl() hexin
@ 2020-07-20 15:29 ` Markus Elfring
0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2020-07-20 15:29 UTC (permalink / raw)
To: hexin.op, dri-devel, virtualization, linux-media, linaro-mm-sig
Cc: Christian König, Daniel Vetter, David Airlie, Gerd Hoffmann,
Sumit Semwal, Liu Qi, linux-kernel
> … 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
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-07-20 15:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-20 14:44 [PATCH v2] drm/virtio: fixed memory leak in virtio_gpu_execbuffer_ioctl() hexin
2020-07-20 15:29 ` [PATCH v2] drm/virtio: Fix " Markus Elfring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).