summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@freedesktop.org>2020-11-16 16:23:47 -0800
committerDylan Baker <dylan.c.baker@intel.com>2020-11-17 10:57:32 -0800
commitf076b4d3ab9b56f9ee2316f6df2898d0a13ce517 (patch)
tree87a91367052a931eb52ac31ff0783efec3b1c1c7
parentf6a73228a47915e703afcc1e13b8a9b752504c36 (diff)
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 <vlee@freedesktop.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7647> (cherry picked from commit 69cad1f96ef4481cc2395def9c993ddcbb0e2540)
-rw-r--r--.pick_status.json2
-rw-r--r--src/freedreno/vulkan/tu_wsi_display.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/.pick_status.json b/.pick_status.json
index a53dfb071ca..06eab24a6e5 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -463,7 +463,7 @@
"description": "turnip: Close sync_fd only if it is a valid file descriptor.",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "cec0bc73e550859635a71d330625bccdf71e87ee"
},
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);