Mesa (main): panvk: Add check for null fence

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 7 21:36:04 UTC 2021


Module: Mesa
Branch: main
Commit: def254b05ff999cd0e1b2723cd0757165ebae421
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=def254b05ff999cd0e1b2723cd0757165ebae421

Author: Manas Chaudhary <manas.chaudhary at collabora.com>
Date:   Tue Dec  7 19:34:08 2021 +0530

panvk: Add check for null fence

Signed-off-by: Manas Chaudhary <manas.chaudhary at collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14108>

---

 src/panfrost/vulkan/panvk_sync.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/panfrost/vulkan/panvk_sync.c b/src/panfrost/vulkan/panvk_sync.c
index 9238ffc5229..91f905bd589 100644
--- a/src/panfrost/vulkan/panvk_sync.c
+++ b/src/panfrost/vulkan/panvk_sync.c
@@ -238,6 +238,9 @@ panvk_DestroyFence(VkDevice _device, VkFence _fence,
    VK_FROM_HANDLE(panvk_device, device, _device);
    VK_FROM_HANDLE(panvk_fence, fence, _fence);
 
+   if (!fence)
+      return;
+
    sync_destroy(device, &fence->syncobj);
    vk_object_free(&device->vk, pAllocator, fence);
 }



More information about the mesa-commit mailing list