From bd411c4c5fd5329757fbb8acd0ca978d73244288 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: (cherry picked from commit e5877cefc4d62d3912b98ee83a12478fb6dc383e) --- .pick_status.json | 2 +- src/panfrost/vulkan/panvk_vX_device.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 75335b4ea1b..80bbfae9892 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2604,7 +2604,7 @@ "description": "panvk: Call vk_free on queue array instead of vk_object_free", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "5b0ff2643f22a25dc167c46d8392ec2da77f5b5f", "notes": null diff --git a/src/panfrost/vulkan/panvk_vX_device.c b/src/panfrost/vulkan/panvk_vX_device.c index 97398a2302d..3ada538f87e 100644 --- a/src/panfrost/vulkan/panvk_vX_device.c +++ b/src/panfrost/vulkan/panvk_vX_device.c @@ -311,7 +311,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); @@ -346,7 +346,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);