From e5877cefc4d62d3912b98ee83a12478fb6dc383e Mon Sep 17 00:00:00 2001 From: Mary Guillemard Date: Wed, 27 Nov 2024 09:15:15 +0100 Subject: [PATCH] panvk: Call vk_free on queue array instead of vk_object_free This is allocated using vk_alloc and isn't a vk_object. This fixes an invalid free that could manifest as a double free error. Signed-off-by: Mary Guillemard Fixes: 5b0ff2643f2 ("panvk: Make the device creation/destruction per-arch") Reviewed-by: Erik Faye-Lund Part-of: --- src/panfrost/vulkan/panvk_vX_device.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/panfrost/vulkan/panvk_vX_device.c b/src/panfrost/vulkan/panvk_vX_device.c index b9096b60b86..a2d8a597512 100644 --- a/src/panfrost/vulkan/panvk_vX_device.c +++ b/src/panfrost/vulkan/panvk_vX_device.c @@ -366,7 +366,7 @@ err_finish_queues: for (unsigned q = 0; q < device->queue_count[i]; q++) panvk_per_arch(queue_finish)(&device->queues[i][q]); if (device->queues[i]) - vk_object_free(&device->vk, NULL, device->queues[i]); + vk_free(&device->vk.alloc, device->queues[i]); } panvk_meta_cleanup(device); @@ -402,7 +402,7 @@ panvk_per_arch(destroy_device)(struct panvk_device *device, for (unsigned q = 0; q < device->queue_count[i]; q++) panvk_per_arch(queue_finish)(&device->queues[i][q]); if (device->queue_count[i]) - vk_object_free(&device->vk, NULL, device->queues[i]); + vk_free(&device->vk.alloc, device->queues[i]); } panvk_meta_cleanup(device);