From cd9907e7d39961e60bb68314139d6f74836b502b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20=C5=9Alusarz?= Date: Wed, 4 Nov 2020 17:49:54 +0100 Subject: [PATCH] anv: remove dead code from anv_create_cmd_buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pool can't be NULL at this point, because it was already dereferenced earlier. Addresses "Dereference before null check" issue reported by Coverity. Signed-off-by: Marcin Ĺšlusarz Reviewed-by: Jason Ekstrand Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_cmd_buffer.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index bbd1c9ac47f..c28a8fc2d88 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -270,14 +270,7 @@ static VkResult anv_create_cmd_buffer( anv_cmd_state_init(cmd_buffer); - if (pool) { - list_addtail(&cmd_buffer->pool_link, &pool->cmd_buffers); - } else { - /* Init the pool_link so we can safefly call list_del when we destroy - * the command buffer - */ - list_inithead(&cmd_buffer->pool_link); - } + list_addtail(&cmd_buffer->pool_link, &pool->cmd_buffers); *pCommandBuffer = anv_cmd_buffer_to_handle(cmd_buffer);