From 7f2ef6a60224e0c0832548df9c464d2c954700f2 Mon Sep 17 00:00:00 2001 From: David Yat Sin <77975354+dayatsin-amd@users.noreply.github.com> Date: Fri, 10 Oct 2025 14:06:31 -0400 Subject: [PATCH] rocr: Return error on signal alloc failure (#1310) Return HSA_STATUS_ERROR_OUT_OF_RESOURCES when signal allocation fails. --- .../runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp index b311fe9861..cf342e41bd 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/hsa_ext_amd.cpp @@ -565,6 +565,9 @@ hsa_status_t hsa_amd_signal_create(hsa_signal_value_t initial_value, uint32_t nu ret = new core::InterruptSignal(initial_value); } + if (ret == nullptr) + return HSA_STATUS_ERROR_OUT_OF_RESOURCES; + *hsa_signal = core::Signal::Convert(ret); return HSA_STATUS_SUCCESS; CATCH;