[Mesa-dev] [PATCH 2/2] anv: Check that in_fence fd is valid before closing it.
Francisco Jerez
currojerez at riseup.net
Fri Aug 18 20:52:08 UTC 2017
Probably harmless, but will overwrite errno with a failure status
code. Reported by coverity.
CID 1416600: Argument cannot be negative (NEGATIVE_RETURNS)
---
src/intel/vulkan/anv_batch_chain.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 26b5375..1e7455f 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -1571,7 +1571,8 @@ anv_cmd_buffer_execbuf(struct anv_device *device,
result = anv_device_execbuf(device, &execbuf.execbuf, execbuf.bos);
/* Execbuf does not consume the in_fence. It's our job to close it. */
- close(in_fence);
+ if (in_fence != -1)
+ close(in_fence);
for (uint32_t i = 0; i < num_in_semaphores; i++) {
ANV_FROM_HANDLE(anv_semaphore, semaphore, in_semaphores[i]);
--
2.10.2
More information about the mesa-dev
mailing list