From: Paulo Zanoni Date: Sat, 14 Jan 2023 00:51:59 +0000 (-0800) Subject: anv: check the return value of anv_execbuf_add_bo_bitset() X-Git-Tag: upstream/23.3.3~14378 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d37950fd9ddc7b43f06b4a5fa710fb7333978ce;p=platform%2Fupstream%2Fmesa.git anv: check the return value of anv_execbuf_add_bo_bitset() Because anv_execbuf_add_bo_bitset() calls anv_execbuf_add_bo(), which can fail if its memory allocations fail. I have seen dEQP tests exercising memory allocation failures during anv_execbuf_add_bo(), but I don't think the path coming from add_bo_biset() was specifically exercised. Anyway, add the error check just in case. v2: Rebase. Cc: mesa-stable Reviewed-by: Ivan Briano Reviewed-by: Lionel Landwerlin Signed-off-by: Paulo Zanoni Part-of: --- diff --git a/src/intel/vulkan/i915/anv_batch_chain.c b/src/intel/vulkan/i915/anv_batch_chain.c index 4e71985..705c5a0 100644 --- a/src/intel/vulkan/i915/anv_batch_chain.c +++ b/src/intel/vulkan/i915/anv_batch_chain.c @@ -292,9 +292,11 @@ setup_execbuf_for_cmd_buffer(struct anv_execbuf *execbuf, { VkResult result; /* Add surface dependencies (BOs) to the execbuf */ - anv_execbuf_add_bo_bitset(cmd_buffer->device, execbuf, - cmd_buffer->surface_relocs.dep_words, - cmd_buffer->surface_relocs.deps, 0); + result = anv_execbuf_add_bo_bitset(cmd_buffer->device, execbuf, + cmd_buffer->surface_relocs.dep_words, + cmd_buffer->surface_relocs.deps, 0); + if (result != VK_SUCCESS) + return result; /* First, we walk over all of the bos we've seen and add them and their * relocations to the validate list.