From da2233a1089ac1d0bb1d65e1ffb01d4b34689d3a Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Sat, 30 Jul 2022 17:09:48 +0200 Subject: [PATCH] vulkan: Handle descriptor set layout alloc fails Fixes: 949ce92 ("vulkan: Add a base struct for descriptor set layouts") Signed-off-by: Konstantin Seurer Reviewed-by: Jason Ekstrand Part-of: --- src/vulkan/runtime/vk_descriptor_set_layout.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vulkan/runtime/vk_descriptor_set_layout.c b/src/vulkan/runtime/vk_descriptor_set_layout.c index 5d50d557d20..f70302a101c 100644 --- a/src/vulkan/runtime/vk_descriptor_set_layout.c +++ b/src/vulkan/runtime/vk_descriptor_set_layout.c @@ -46,6 +46,8 @@ vk_descriptor_set_layout_zalloc(struct vk_device *device, size_t size) */ struct vk_descriptor_set_layout *layout = vk_zalloc(&device->alloc, size, 8, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); + if (!layout) + return NULL; vk_descriptor_set_layout_init(device, layout); @@ -63,6 +65,8 @@ vk_descriptor_set_layout_multizalloc(struct vk_device *device, struct vk_descriptor_set_layout *layout = vk_multialloc_zalloc(ma, &device->alloc, VK_SYSTEM_ALLOCATION_SCOPE_DEVICE); + if (!layout) + return NULL; vk_descriptor_set_layout_init(device, layout);