summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-12-01 00:44:45 +0000
committerBas Nieuwenhuizen <[email protected]>2016-12-17 16:29:57 +0100
commit7ad1c24e2afab3aacd56af9ffb48e2538d3dd3ee (patch)
tree97125b929757bb5f38c8fb30f7da614b13ae4ef5
parentb2b4f7248bee0121d6099f8b641a034eed13a15e (diff)
radv: handle fence allocation failing
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
-rw-r--r--src/amd/vulkan/radv_device.c5
1 files changed, 4 insertions, 1 deletions
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);