Module: Mesa Branch: master Commit: 69cad1f96ef4481cc2395def9c993ddcbb0e2540 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=69cad1f96ef4481cc2395def9c993ddcbb0e2540
Author: Vinson Lee <[email protected]> Date: Mon Nov 16 16:23:47 2020 -0800 turnip: Close sync_fd only if it is a valid file descriptor. Fix defects reported by Coverity Scan. Argument cannot be negative (NEGATIVE_RETURNS) negative_returns: sync_fd is passed to a parameter that cannot be negative. Fixes: cec0bc73e55 ("turnip: rework fences to use syncobjs") Signed-off-by: Vinson Lee <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7647> --- src/freedreno/vulkan/tu_wsi_display.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/freedreno/vulkan/tu_wsi_display.c b/src/freedreno/vulkan/tu_wsi_display.c index 1ac1b7d152a..9227ca63db1 100644 --- a/src/freedreno/vulkan/tu_wsi_display.c +++ b/src/freedreno/vulkan/tu_wsi_display.c @@ -282,12 +282,12 @@ tu_RegisterDeviceEventEXT(VkDevice _device, allocator, NULL, sync_fd); + + close(sync_fd); } else { ret = VK_ERROR_OUT_OF_HOST_MEMORY; } - close(sync_fd); - if (ret != VK_SUCCESS) tu_DestroyFence(_device, *_fence, allocator); @@ -319,12 +319,12 @@ tu_RegisterDisplayEventEXT(VkDevice _device, allocator, NULL, sync_fd); + + close(sync_fd); } else { ret = VK_ERROR_OUT_OF_HOST_MEMORY; } - close(sync_fd); - if (ret != VK_SUCCESS) tu_DestroyFence(_device, *_fence, allocator); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
