anv: handle allocation failure in anv_batch_emit_dwords()

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
This commit is contained in:
Iago Toral Quiroga 2017-03-03 10:56:33 +01:00
parent 9e69409fcf
commit 31f5049ff1

View file

@ -195,8 +195,13 @@ anv_reloc_list_append(struct anv_reloc_list *list,
void *
anv_batch_emit_dwords(struct anv_batch *batch, int num_dwords)
{
if (batch->next + num_dwords * 4 > batch->end)
batch->extend_cb(batch, batch->user_data);
if (batch->next + num_dwords * 4 > batch->end) {
VkResult result = batch->extend_cb(batch, batch->user_data);
if (result != VK_SUCCESS) {
anv_batch_set_error(batch, result);
return NULL;
}
}
void *p = batch->next;