radv: handle fence allocation failing
authorDave Airlie <airlied@redhat.com>
Thu, 1 Dec 2016 00:44:45 +0000 (00:44 +0000)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sat, 17 Dec 2016 15:29:57 +0000 (16:29 +0100)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c

index 75b7af1fd078bc94ceb745df88fcedbf9edd1253..c1438feb85200569b71b6902d83ae91b8c3b204b 100644 (file)
@@ -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);