anv: check return value of anv_execbuf_add_bo
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 8 May 2017 08:01:56 +0000 (09:01 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Mon, 8 May 2017 13:38:27 +0000 (14:38 +0100)
CID: 1405919 (Error handling issues)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/intel/vulkan/anv_batch_chain.c

index 6d6babadea1f4eede16258161a34694e56d01b47..9def174b429d48b4305963a94a2920e16c927687 100644 (file)
@@ -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;
       }
    }