[Mesa-dev] [PATCH 2/2] anv: check return value of anv_execbuf_add_bo

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon May 8 08:15:34 UTC 2017


CID: 1405919 (Error handling issues)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/intel/vulkan/anv_batch_chain.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c
index 6d6babadea1..9def174b429 100644
--- a/src/intel/vulkan/anv_batch_chain.c
+++ b/src/intel/vulkan/anv_batch_chain.c
@@ -1048,10 +1048,15 @@ anv_execbuf_add_bo(struct anv_execbuf *exec,
       obj->relocs_ptr = (uintptr_t) relocs->relocs;
 
       for (size_t i = 0; i < relocs->num_relocs; i++) {
+         VkResult result;
+
          /* A quick sanity check on relocations */
          assert(relocs->relocs[i].offset < bo->size);
-         anv_execbuf_add_bo(exec, relocs->reloc_bos[i], NULL,
-                            extra_flags, alloc);
+         result = anv_execbuf_add_bo(exec, relocs->reloc_bos[i], NULL,
+                                     extra_flags, alloc);
+
+         if (result != VK_SUCCESS)
+            return result;
       }
    }
 
-- 
2.11.0



More information about the mesa-dev mailing list