anv/batch_chain: Handle another OOM in cmd_buffer_execbuf
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 29 Mar 2017 00:33:06 +0000 (17:33 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 29 Mar 2017 16:39:49 +0000 (09:39 -0700)
Found by inspection while rebasing other patches.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
src/intel/vulkan/anv_batch_chain.c

index 5d7abc68b32fa87ac257738ff843e0deed1dda9a..5a6c0ba1a963b3314ebf3b58e9045e7b19855f07 100644 (file)
@@ -1277,8 +1277,10 @@ anv_cmd_buffer_execbuf(struct anv_device *device,
       adjust_relocations_to_state_pool(ss_pool, &(*bbo)->bo, &(*bbo)->relocs,
                                        cmd_buffer->last_ss_pool_center);
 
-      anv_execbuf_add_bo(&execbuf, &(*bbo)->bo, &(*bbo)->relocs,
-                         &cmd_buffer->pool->alloc);
+      result = anv_execbuf_add_bo(&execbuf, &(*bbo)->bo, &(*bbo)->relocs,
+                                  &cmd_buffer->pool->alloc);
+      if (result != VK_SUCCESS)
+         return result;
    }
 
    /* Now that we've adjusted all of the surface state relocations, we need to