diff options
author | Emil Velikov <[email protected]> | 2016-11-24 20:30:43 +0000 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2016-11-28 19:47:34 +0000 |
commit | a1cf494f7740c2afb851ffc3248e2cfa54d74ead (patch) | |
tree | 9d2bb11457fd3ed689c3169d398fb8bcb4f851cb | |
parent | 3af81715470f8d656fe8b8e35475ed2b5fc766da (diff) |
anv: don't leak memory if anv_init_wsi() fails
brw_compiler_create() rzalloc-ates memory which we forgot to free.
Cc: "13.0" <[email protected]>
Signed-off-by: Emil Velikov <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/intel/vulkan/anv_device.c | 6 |
1 files 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); |