From 0a36fafa95175efbad1a61b36706e535929afd2b Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 2 Dec 2019 13:51:59 -0600 Subject: [PATCH] anv: Don't leak when set_tiling fails Fixes: a44744e01d73 "anv: Require a dedicated allocation for..." Reviewed-by: Ivan Briano Reviewed-by: Lionel Landwerlin --- src/intel/vulkan/anv_device.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; } } } -- 2.30.2