anv: Check file descriptor before closing.
Fix defect reported by Coverity Scan. Argument cannot be negative (NEGATIVE_RETURNS) negative_returns: fd is passed to a parameter that cannot be negative Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6643>
This commit is contained in:
@@ -1915,7 +1915,8 @@ VkResult anv_ImportFenceFdKHR(
|
||||
*
|
||||
* If the import fails, we leave the file descriptor open.
|
||||
*/
|
||||
close(fd);
|
||||
if (fd != -1)
|
||||
close(fd);
|
||||
|
||||
if (pImportFenceFdInfo->flags & VK_FENCE_IMPORT_TEMPORARY_BIT) {
|
||||
anv_fence_impl_cleanup(device, &fence->temporary);
|
||||
|
Reference in New Issue
Block a user