From bac048e1dfed0ddfa7d95e55565d0ac486997b9b Mon Sep 17 00:00:00 2001 From: Karmjit Mahil Date: Thu, 4 May 2023 16:37:28 +0100 Subject: pvr: Add missing NULL checks in some vkDestroy...() functions Seems like `dEQP-VK.api.null_handle.destroy_device` was already passing but let's add the null check in case of future changes which might not accept NULL. Fixes: dEQP-VK.api.null_handle.destroy_descriptor_set_layout dEQP-VK.api.null_handle.destroy_pipeline_layout dEQP-VK.api.null_handle.destroy_query_pool Signed-off-by: Karmjit Mahil Reviewed-by: Frank Binns Part-of: --- src/imagination/vulkan/pvr_descriptor_set.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/imagination/vulkan/pvr_descriptor_set.c') diff --git a/src/imagination/vulkan/pvr_descriptor_set.c b/src/imagination/vulkan/pvr_descriptor_set.c index 57b84c395af..1855876839c 100644 --- a/src/imagination/vulkan/pvr_descriptor_set.c +++ b/src/imagination/vulkan/pvr_descriptor_set.c @@ -675,6 +675,9 @@ void pvr_DestroyDescriptorSetLayout(VkDevice _device, PVR_FROM_HANDLE(pvr_descriptor_set_layout, layout, _set_layout); PVR_FROM_HANDLE(pvr_device, device, _device); + if (!layout) + return; + pvr_descriptor_set_layout_free(device, pAllocator, layout); } @@ -1031,6 +1034,9 @@ void pvr_DestroyPipelineLayout(VkDevice _device, PVR_FROM_HANDLE(pvr_device, device, _device); PVR_FROM_HANDLE(pvr_pipeline_layout, layout, _pipelineLayout); + if (!layout) + return; + vk_object_free(&device->vk, pAllocator, layout); } -- cgit v1.2.1