anv: Don't leak when set_tiling fails

Fixes: a44744e01d "anv: Require a dedicated allocation for..."
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
This commit is contained in:
Jason Ekstrand 2019-12-02 13:51:59 -06:00
parent 46af0ecc1d
commit 0a36fafa95
1 changed files with 4 additions and 3 deletions

View File

@ -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;
}
}
}