[Mesa-stable] [Mesa-dev] [PATCH 6/8] anv: don't leak memory if anv_init_wsi() fails

Jason Ekstrand jason at jlekstrand.net
Sat Nov 26 05:43:55 UTC 2016


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

On Thu, Nov 24, 2016 at 12:30 PM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:

> From: Emil Velikov <emil.velikov at collabora.com>
>
> brw_compiler_create() rzalloc-ates memory which we forgot to free.
>
> Cc: "13.0" <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  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 0e01e28..b4c2e4b 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -203,8 +203,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;
> +   }
>
>     if (anv_device_get_cache_uuid(device->uuid)) {
>        anv_finish_wsi(device);
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-stable/attachments/20161125/2b918199/attachment.html>


More information about the mesa-stable mailing list