diff options
author | Lasse Lopperi <[email protected]> | 2020-01-10 10:47:55 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-10 16:21:35 +0000 |
commit | 3de2774dcb85fb2f87ae65a854fc5f25f0f34a91 (patch) | |
tree | 530a9a47ba65a793eeed811efb474091202eae34 | |
parent | b5c9688516d00b00184e6fa6868de826916f5fc3 (diff) |
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 <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3342>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3342>
-rw-r--r-- | src/freedreno/drm/msm_ringbuffer_sp.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); } |