Mesa (main): device_select: close dri3 fd after using it.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 6 08:46:47 UTC 2021


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

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Oct  6 17:13:46 2021 +1000

device_select: close dri3 fd after using it.

This can leak and causes crashes in some CTS test groups
dEQP-VK.wsi.xcb.incremental_present*

Fixes: 9bc5b2d169d3 ("vulkan: add initial device selection layer. (v6.1)")
Reviewed-by: Michel Dänzer <mdaenzer at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13215>

---

 src/vulkan/device-select-layer/device_select_x11.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/vulkan/device-select-layer/device_select_x11.c b/src/vulkan/device-select-layer/device_select_x11.c
index 93b39f269a4..b17402e7b06 100644
--- a/src/vulkan/device-select-layer/device_select_x11.c
+++ b/src/vulkan/device-select-layer/device_select_x11.c
@@ -93,6 +93,7 @@ int device_select_find_xcb_pci_default(struct device_pci_info *devices, uint32_t
 
   drmDevicePtr xdev;
   int ret = drmGetDevice2(dri3_fd, 0, &xdev);
+  close(dri3_fd);
   if (ret < 0)
     goto out;
 



More information about the mesa-commit mailing list