From 7ad1c24e2afab3aacd56af9ffb48e2538d3dd3ee Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 1 Dec 2016 00:44:45 +0000 Subject: [PATCH] radv: handle fence allocation failing Reviewed-by: Bas Nieuwenhuizen --- src/amd/vulkan/radv_device.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 75b7af1fd07..c1438feb852 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -1131,7 +1131,10 @@ VkResult radv_CreateFence( fence->submitted = false; fence->signalled = !!(pCreateInfo->flags & VK_FENCE_CREATE_SIGNALED_BIT); fence->fence = device->ws->create_fence(); - + if (!fence->fence) { + vk_free2(&device->alloc, pAllocator, fence); + return VK_ERROR_OUT_OF_HOST_MEMORY; + } *pFence = radv_fence_to_handle(fence); -- 2.30.2