From: Iago Toral Quiroga Date: Fri, 3 Mar 2017 09:56:33 +0000 (+0100) Subject: anv: handle allocation failure in anv_batch_emit_dwords() X-Git-Tag: upstream/17.1.0~1326 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=31f5049ff1c851d1b8652c7cb42740a6a7db58de;p=platform%2Fupstream%2Fmesa.git anv: handle allocation failure in anv_batch_emit_dwords() Reviewed-by: Topi Pohjolainen --- diff --git a/src/intel/vulkan/anv_batch_chain.c b/src/intel/vulkan/anv_batch_chain.c index 40fc2f4..c304d6d 100644 --- a/src/intel/vulkan/anv_batch_chain.c +++ b/src/intel/vulkan/anv_batch_chain.c @@ -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;