v3d: Fix leak of the mem_ctx after the DAG refactor.
authorEric Anholt <eric@anholt.net>
Tue, 12 Mar 2019 21:56:57 +0000 (14:56 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 12 Mar 2019 23:15:40 +0000 (16:15 -0700)
Noticed while trying to get a CTS run again.

Fixes: 33886474d646 ("v3d: Use the DAG datastructure for QPU instruction scheduling.")
src/broadcom/compiler/qpu_schedule.c

index c7c120638168cd0345c2761633d6fe48c0bf0f70..d275940c136024859150232a37e39c95472bafc2 100644 (file)
@@ -1338,7 +1338,7 @@ qpu_schedule_instructions_block(struct v3d_compile *c,
                                 uint32_t *next_uniform)
 {
         void *mem_ctx = ralloc_context(NULL);
-        scoreboard->dag = dag_create(NULL);
+        scoreboard->dag = dag_create(mem_ctx);
         struct list_head setup_list;
 
         list_inithead(&setup_list);
@@ -1366,7 +1366,7 @@ qpu_schedule_instructions_block(struct v3d_compile *c,
                                                 orig_uniform_data,
                                                 next_uniform);
 
-        ralloc_free(scoreboard->dag);
+        ralloc_free(mem_ctx);
         scoreboard->dag = NULL;
 
         return cycles;