[Mesa-dev] [PATCH 03/16] anv: don't crash if we fail to grow the reloc list
Iago Toral Quiroga
itoral at igalia.com
Tue Mar 7 07:15:48 UTC 2017
---
src/intel/vulkan/anv_batch_chain.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 3f6039e..4cbfb4d 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -151,8 +151,9 @@ anv_reloc_list_add(struct anv_reloc_list *list,
const uint32_t domain =
target_bo->is_winsys_bo ? I915_GEM_DOMAIN_RENDER : 0;
- anv_reloc_list_grow(list, alloc, 1);
- /* TODO: Handle failure */
+ VkResult result = anv_reloc_list_grow(list, alloc, 1);
+ if (result != VK_SUCCESS)
+ return 0;
/* XXX: Can we use I915_EXEC_HANDLE_LUT? */
index = list->num_relocs++;
@@ -174,8 +175,9 @@ anv_reloc_list_append(struct anv_reloc_list *list,
const VkAllocationCallbacks *alloc,
struct anv_reloc_list *other, uint32_t offset)
{
- anv_reloc_list_grow(list, alloc, other->num_relocs);
- /* TODO: Handle failure */
+ VkResult result = anv_reloc_list_grow(list, alloc, other->num_relocs);
+ if (result != VK_SUCCESS)
+ return;
memcpy(&list->relocs[list->num_relocs], &other->relocs[0],
other->num_relocs * sizeof(other->relocs[0]));
--
2.7.4
More information about the mesa-dev
mailing list