From: Emil Velikov Date: Thu, 24 Nov 2016 20:30:43 +0000 (+0000) Subject: anv: don't leak memory if anv_init_wsi() fails X-Git-Tag: upstream/17.1.0~4297 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a1cf494f7740c2afb851ffc3248e2cfa54d74ead;p=platform%2Fupstream%2Fmesa.git 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 --- diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index a410376..0518aaf 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);