freedreno/drm: fix memory leak
authorRob Clark <robdclark@gmail.com>
Fri, 7 Dec 2018 19:11:01 +0000 (14:11 -0500)
committerRob Clark <robdclark@gmail.com>
Fri, 7 Dec 2018 19:12:12 +0000 (14:12 -0500)
Fix an emberrasing memory leak with the non-softpin submit/rb
implementation.

Fixes: f3cc0d27475 freedreno: import libdrm_freedreno + redesign submit
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/freedreno/drm/msm_ringbuffer.c

index 673ef436e25964e760a49715de1bb60e1e80f4d9..369f26f9837609cb45868b68e723cacb9dc23bce 100644 (file)
@@ -97,6 +97,7 @@ static void
 cmd_free(struct msm_cmd *cmd)
 {
        fd_bo_del(cmd->ring_bo);
+       free(cmd->relocs);
        free(cmd);
 }
 
@@ -653,6 +654,7 @@ msm_ringbuffer_destroy(struct fd_ringbuffer *ring)
 
                _mesa_set_destroy(msm_ring->u.ring_set, unref_rings);
 
+               free(msm_ring->u.reloc_bos);
                free(msm_ring);
        } else {
                struct fd_submit *submit = msm_ring->u.submit;
@@ -661,6 +663,7 @@ msm_ringbuffer_destroy(struct fd_ringbuffer *ring)
                        cmd_free(msm_ring->u.cmds[i]);
                }
 
+               free(msm_ring->u.cmds);
                slab_free_st(&to_msm_submit(submit)->ring_pool, msm_ring);
        }
 }