From 2263576f59a0fa33fb051c4bcf9bc44cbfabe865 Mon Sep 17 00:00:00 2001 From: Utku Iseri Date: Mon, 20 Apr 2026 14:17:51 +0200 Subject: [PATCH] v3dv: close display_fd on incompatible_driver path Currently, display_fd gets leaked during vulkan loader driver probing on platforms where there's no v3dv device, as nothing closes this fd before returning with INCOMPATIBLE_DRIVER. As the display_fd also holds MASTER, this in turn prevents the actual driver from becoming master on the display node. Close the fd before returning to prevent this. Fixes: bb532a7a ("v3dv: Fix assertion failure for not-found primary_fd during enumeration.") Reviewed-by: Iago Toral Quiroga Part-of: --- src/broadcom/vulkan/v3dv_device.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/broadcom/vulkan/v3dv_device.c b/src/broadcom/vulkan/v3dv_device.c index cbf57788cd9..f5dd06e7bd9 100644 --- a/src/broadcom/vulkan/v3dv_device.c +++ b/src/broadcom/vulkan/v3dv_device.c @@ -1670,9 +1670,11 @@ enumerate_devices(struct vk_instance *vk_instance) break; } - if (render_fd < 0) + if (render_fd < 0) { + if (display_fd != -1) + close(display_fd); result = VK_ERROR_INCOMPATIBLE_DRIVER; - else + } else result = create_physical_device(instance, primary_fd, render_fd, display_fd); drmFreeDevices(devices, max_devices);