From 2f925686708a1891f25ad3a14999be4dc197df55 Mon Sep 17 00:00:00 2001 From: Yufeng Shi Date: Thu, 6 Nov 2025 16:08:32 +0000 Subject: [PATCH] Arm backend: Return false on non-VK_SUCCESS in process_vgf Replace incorrect `return result;` (VkResult) in a bool path to avoid false success. Change-Id: I842ffbed90f3f511695fc06820c167246f92e13a Signed-off-by: Yufeng Shi Co-authored-by: Alan Liang --- backends/arm/runtime/VGFSetup.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/backends/arm/runtime/VGFSetup.cpp b/backends/arm/runtime/VGFSetup.cpp index fa8c7ead220..fd3a114c190 100644 --- a/backends/arm/runtime/VGFSetup.cpp +++ b/backends/arm/runtime/VGFSetup.cpp @@ -707,7 +707,7 @@ bool VgfRepr::process_vgf(const char* vgf_data, ArrayRef specs) { ); if (result != VK_SUCCESS) { ET_LOG(Error, "Failed to create DataGraphPipeline"); - return result; + return false; } // prepare the graph pipeline session @@ -721,7 +721,7 @@ bool VgfRepr::process_vgf(const char* vgf_data, ArrayRef specs) { vk_device, &pipeline_session_info, nullptr, &vk_session); if (result != VK_SUCCESS) { ET_LOG(Error, "Failed to create DataGraphPipelineSession"); - return result; + return false; } // Allocate command buffer @@ -735,7 +735,7 @@ bool VgfRepr::process_vgf(const char* vgf_data, ArrayRef specs) { vk_device, &buffer_allocate_info, &vk_execute_cmd); if (result != VK_SUCCESS) { ET_LOG(Error, "Failed to allocate command buffers"); - return result; + return false; } // Allocate intermediates memory based on the pipeline requirements provided @@ -753,7 +753,7 @@ bool VgfRepr::process_vgf(const char* vgf_data, ArrayRef specs) { vk_device, &bind_point_requirements_info, &bind_point_count, nullptr); if (result != VK_SUCCESS) { ET_LOG(Error, "Failed to get session bind point count"); - return result; + return false; } vector @@ -766,7 +766,7 @@ bool VgfRepr::process_vgf(const char* vgf_data, ArrayRef specs) { bind_point_requirements.data()); if (result != VK_SUCCESS) { ET_LOG(Error, "Failed to get session bind point requirements"); - return result; + return false; } // Given the bind points, just make individual allocations and bind them @@ -777,18 +777,18 @@ bool VgfRepr::process_vgf(const char* vgf_data, ArrayRef specs) { ET_LOG( Error, "Expected VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_TYPE_MEMORY_ARM"); - return VK_ERROR_UNKNOWN; + return false; } if (bind_point_requirement.bindPoint != VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_TRANSIENT_ARM) { ET_LOG( Error, "Expected VK_DATA_GRAPH_PIPELINE_SESSION_BIND_POINT_TRANSIENT_ARM"); - return VK_ERROR_UNKNOWN; + return false; } if (bind_point_requirement.numObjects != 1) { ET_LOG(Error, "Expected only one object for the bindpoint"); - return VK_ERROR_UNKNOWN; + return false; } VkDataGraphPipelineSessionMemoryRequirementsInfoARM memory_requirements_info = { @@ -821,7 +821,7 @@ bool VgfRepr::process_vgf(const char* vgf_data, ArrayRef specs) { vkAllocateMemory(vk_device, &memory_allocate_info, nullptr, &memory); if (result != VK_SUCCESS) { ET_LOG(Error, "Failed to allocate memory for intermediates"); - return result; + return false; } // so we can free this object in destructor intermediates.push_back(memory); @@ -839,7 +839,7 @@ bool VgfRepr::process_vgf(const char* vgf_data, ArrayRef specs) { result = vkBindDataGraphPipelineSessionMemoryARM(vk_device, 1, &bind_info); if (result != VK_SUCCESS) { ET_LOG(Error, "Failed to bind intermediates memory"); - return result; + return false; } }