From 1f5966397aa208eb574394a4d0a592b66b776b44 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Wed, 2 Nov 2022 08:53:12 +0100 Subject: [PATCH] v3dv: handle allocation failure during pipeline initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes (with disk cache disabled): dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic dEQP-VK.api.object_management.alloc_callback_fail.device dEQP-VK.api.object_management.alloc_callback_fail.device_group Reviewed-by: Alejandro PiƱeiro Reviewed-by: Eric Engestrom cc: mesa-stable Part-of: --- src/broadcom/vulkan/v3dv_pipeline.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/broadcom/vulkan/v3dv_pipeline.c b/src/broadcom/vulkan/v3dv_pipeline.c index 058ed0ef0f9..1fdbb85708a 100644 --- a/src/broadcom/vulkan/v3dv_pipeline.c +++ b/src/broadcom/vulkan/v3dv_pipeline.c @@ -2411,6 +2411,8 @@ pipeline_compile_graphics(struct v3dv_pipeline *pipeline, */ pipeline->shared_data = v3dv_pipeline_shared_data_new_empty(pipeline->sha1, pipeline, true); + if (!pipeline->shared_data) + return VK_ERROR_OUT_OF_HOST_MEMORY; struct v3dv_pipeline_stage *p_stage_vs = pipeline->stages[BROADCOM_SHADER_VERTEX]; struct v3dv_pipeline_stage *p_stage_fs = pipeline->stages[BROADCOM_SHADER_FRAGMENT]; @@ -3133,6 +3135,8 @@ pipeline_compile_compute(struct v3dv_pipeline *pipeline, pipeline->shared_data = v3dv_pipeline_shared_data_new_empty(pipeline->sha1, pipeline, false); + if (!pipeline->shared_data) + return VK_ERROR_OUT_OF_HOST_MEMORY; p_stage->feedback.flags |= VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT;