summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_cs_legacy.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c
index ef59dd1f5c..f09031e83b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c
+++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c
@@ -335,11 +335,15 @@ static int cs_emit(struct radeon_cs *cs)
return 0;
}
+static void inline cs_free_reloc(void *relocs_p)
+{
+ struct cs_reloc_legacy *relocs = relocs_p;
+ free(relocs->indices);
+}
+
static int cs_destroy(struct radeon_cs *cs)
{
- struct cs_reloc_legacy *relocs;
- relocs = cs->relocs;
- free(relocs->indices);
+ cs_free_reloc(cs->relocs);
free(cs->relocs);
free(cs->packets);
free(cs);
@@ -348,6 +352,7 @@ static int cs_destroy(struct radeon_cs *cs)
static int cs_erase(struct radeon_cs *cs)
{
+ cs_free_reloc(cs->relocs);
free(cs->relocs);
cs->relocs_total_size = 0;
cs->relocs = NULL;