Mesa (master): radv: Do not close fd -1 when NULL-winsys creation fails.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon May 25 11:25:15 UTC 2020


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

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Sat May 23 02:36:03 2020 +0200

radv: Do not close fd -1 when NULL-winsys creation fails.

Fixes: cd6ec2b1abb "radv: implement a dummy winsys for creating devices without AMDGPU"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5181>

---

 src/amd/vulkan/radv_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index cf41a03b254..dee5563e824 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -443,7 +443,8 @@ fail_wsi:
 fail_alloc:
 	vk_free(&instance->alloc, device);
 fail_fd:
-	close(fd);
+	if (fd != -1)
+		close(fd);
 	if (master_fd != -1)
 		close(master_fd);
 	return result;



More information about the mesa-commit mailing list