From 27328375913d1fce395e3ea17800bf780b7b9ca2 Mon Sep 17 00:00:00 2001 From: Sergio Lopez Date: Tue, 30 Sep 2025 15:54:26 +0000 Subject: [PATCH] hk: fix instance reference in vk_free In hk_create_drm_physical_device() we might call vk_free() passing pdev->vk.instance->alloc as first argument, but if we've arrived there via fail_pdev_alloc the instance has not yet been installed into the physical device, potentially triggering a SIGSEGV. Fix it by using a direct reference to the instance as first argument. Signed-off-by: Sergio Lopez Part-of: --- src/asahi/vulkan/hk_physical_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/asahi/vulkan/hk_physical_device.c b/src/asahi/vulkan/hk_physical_device.c index b9b237aa851..174de4398b0 100644 --- a/src/asahi/vulkan/hk_physical_device.c +++ b/src/asahi/vulkan/hk_physical_device.c @@ -1297,7 +1297,7 @@ fail_pdev_alloc: if (pdev->master_fd) close(pdev->master_fd); - vk_free(&pdev->vk.instance->alloc, pdev); + vk_free(&instance->vk.alloc, pdev); fail_fd: close(fd); return result;