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>
This commit is contained in:
Mary Guillemard
2024-11-27 09:15:15 +01:00
parent 4308668a25
commit e5877cefc4

View File

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