v3dv: close display_fd on incompatible_driver path
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

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 <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41058>
This commit is contained in:
Utku Iseri 2026-04-20 14:17:51 +02:00 committed by Marge Bot
parent e13c270d89
commit 2263576f59

View file

@ -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);