From 3de2774dcb85fb2f87ae65a854fc5f25f0f34a91 Mon Sep 17 00:00:00 2001 From: Lasse Lopperi Date: Fri, 10 Jan 2020 10:47:55 +0200 Subject: freedreno/drm: Fix memory leak in softpin implementation Free the memory allocated for cmds/reloc_bos array when destoying the associated ringbuffer. For similar fix for the non-softpin implementation see: https://gitlab.freedesktop.org/mesa/mesa/commit/d014af98b7afc69f4f733c8b8b6f2e3438e68407 Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2324 Fixes: f3cc0d2 ("freedreno: import libdrm_freedreno + redesign submit") Signed-off-by: Lasse Lopperi Tested-by: Marge Bot Part-of: --- src/freedreno/drm/msm_ringbuffer_sp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/freedreno/drm/msm_ringbuffer_sp.c b/src/freedreno/drm/msm_ringbuffer_sp.c index ec375a19938..41732858580 100644 --- a/src/freedreno/drm/msm_ringbuffer_sp.c +++ b/src/freedreno/drm/msm_ringbuffer_sp.c @@ -509,6 +509,7 @@ msm_ringbuffer_sp_destroy(struct fd_ringbuffer *ring) for (unsigned i = 0; i < msm_ring->u.nr_reloc_bos; i++) { fd_bo_del(msm_ring->u.reloc_bos[i].bo); } + free(msm_ring->u.reloc_bos); free(msm_ring); } else { @@ -517,6 +518,7 @@ msm_ringbuffer_sp_destroy(struct fd_ringbuffer *ring) for (unsigned i = 0; i < msm_ring->u.nr_cmds; i++) { fd_bo_del(msm_ring->u.cmds[i].ring_bo); } + free(msm_ring->u.cmds); slab_free(&to_msm_submit_sp(submit)->ring_pool, msm_ring); } -- cgit v1.2.3