From: Jason Ekstrand Date: Mon, 2 Dec 2019 19:51:59 +0000 (-0600) Subject: anv: Don't leak when set_tiling fails X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a36fafa95175efbad1a61b36706e535929afd2b;p=mesa.git anv: Don't leak when set_tiling fails Fixes: a44744e01d73 "anv: Require a dedicated allocation for..." Reviewed-by: Ivan Briano Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index be4d23356e3..728c65a5c1b 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -3264,9 +3264,10 @@ VkResult anv_AllocateMemory( i915_tiling); if (ret) { anv_device_release_bo(device, mem->bo); - return vk_errorf(device->instance, NULL, - VK_ERROR_OUT_OF_DEVICE_MEMORY, - "failed to set BO tiling: %m"); + result = vk_errorf(device->instance, NULL, + VK_ERROR_OUT_OF_DEVICE_MEMORY, + "failed to set BO tiling: %m"); + goto fail; } } }