summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2016-11-24 20:30:43 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2016-12-14 19:03:09 +0000
commitdeba381a856581512c1c3fd2621b5a8a3b320252 (patch)
treeef9245fef6fe61fc3d1f56dd6a3812bde8ce1f39
parenta5feaf22be3e975a81a99318f5d3264387a9fa66 (diff)
downloadexternal_mesa3d-deba381a856581512c1c3fd2621b5a8a3b320252.zip
external_mesa3d-deba381a856581512c1c3fd2621b5a8a3b320252.tar.gz
external_mesa3d-deba381a856581512c1c3fd2621b5a8a3b320252.tar.bz2
anv: don't leak memory if anv_init_wsi() fails
brw_compiler_create() rzalloc-ates memory which we forgot to free. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit a1cf494f7740c2afb851ffc3248e2cfa54d74ead)
-rw-r--r--src/intel/vulkan/anv_device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index ecdaeb7..98fd40e 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -173,8 +173,10 @@ anv_physical_device_init(struct anv_physical_device *device,
device->compiler->shader_perf_log = compiler_perf_log;
result = anv_init_wsi(device);
- if (result != VK_SUCCESS)
- goto fail;
+ if (result != VK_SUCCESS) {
+ ralloc_free(device->compiler);
+ goto fail;
+ }
/* XXX: Actually detect bit6 swizzling */
isl_device_init(&device->isl_dev, &device->info, swizzled);