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 <mary.guillemard@collabora.com>
Fixes: 5b0ff2643f ("panvk: Make the device creation/destruction per-arch")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32368>
(cherry picked from commit e5877cefc4)
This commit is contained in:
Mary Guillemard
2024-11-27 09:15:15 +01:00
committed by Dylan Baker
parent 7c57de1282
commit bd411c4c5f
2 changed files with 3 additions and 3 deletions

View File

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

View File

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