summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);