From a1cf494f7740c2afb851ffc3248e2cfa54d74ead Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 24 Nov 2016 20:30:43 +0000 Subject: [PATCH] anv: don't leak memory if anv_init_wsi() fails brw_compiler_create() rzalloc-ates memory which we forgot to free. Cc: "13.0" Signed-off-by: Emil Velikov Reviewed-by: Jason Ekstrand --- src/intel/vulkan/anv_device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index a410376a9c7..0518aafadbe 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -208,8 +208,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; + } isl_device_init(&device->isl_dev, &device->info, swizzled); -- 2.30.2