From 4ef3e871cad0ba96c964c571c96a1b87694c7bcd Mon Sep 17 00:00:00 2001 From: Jetson Tan Date: Wed, 19 Aug 2026 23:43:10 +0800 Subject: [PATCH] vulkan: add null checks in ggml_vk_queue_command_pools_cleanup (llama/27353) * Guard against null queue pointers. --- ggml/src/ggml-vulkan/ggml-vulkan.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml-vulkan/ggml-vulkan.cpp b/ggml/src/ggml-vulkan/ggml-vulkan.cpp index 62ef7bb8a..6c60ac0dc 100644 --- a/ggml/src/ggml-vulkan/ggml-vulkan.cpp +++ b/ggml/src/ggml-vulkan/ggml-vulkan.cpp @@ -3384,10 +3384,10 @@ static void ggml_vk_queue_command_pools_cleanup(vk_device& device) { // Arbitrary frequency to cleanup/reuse command buffers static constexpr uint32_t cleanup_frequency = 10; - if (device->compute_queue->cmd_pool.buffers_in_use() >= cleanup_frequency) { + if (device->compute_queue && device->compute_queue->cmd_pool.buffers_in_use() >= cleanup_frequency) { ggml_vk_command_pool_cleanup(device, device->compute_queue->cmd_pool); } - if (device->transfer_queue->cmd_pool.buffers_in_use() >= cleanup_frequency) { + if (device->transfer_queue && device->transfer_queue->cmd_pool.buffers_in_use() >= cleanup_frequency) { ggml_vk_command_pool_cleanup(device, device->transfer_queue->cmd_pool); } }