From 62b3fd0a5eb60d66bba7df246976ed405b561743 Mon Sep 17 00:00:00 2001 From: Wolf480pl Date: Fri, 4 Jul 2025 23:07:41 +0200 Subject: [PATCH] radv/virtio: don't leak drm FD when using vpipe The fd in radv_physical_device_try_create is one we opened in that function. We don't need it when vpipe is in use, so we should close it, before setting it to -1. Fixes: 999d5098b48 ("radv/virtio: support vpipe") Part-of: --- src/amd/vulkan/radv_physical_device.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/amd/vulkan/radv_physical_device.c b/src/amd/vulkan/radv_physical_device.c index 42e499a822b..f9dab08abd9 100644 --- a/src/amd/vulkan/radv_physical_device.c +++ b/src/amd/vulkan/radv_physical_device.c @@ -2105,6 +2105,7 @@ radv_physical_device_try_create(struct radv_instance *instance, drmDevicePtr drm #ifdef HAVE_AMDGPU_VIRTIO if (debug_get_bool_option("AMD_FORCE_VPIPE", false)) { is_virtio = true; + close(fd); fd = -1; } #endif