From adaaa883b2f3f69e3a40eb7c404a9c9ce79aa4e4 Mon Sep 17 00:00:00 2001 From: pghoshamd Date: Thu, 29 Jan 2026 16:53:27 -0500 Subject: [PATCH] SWDEV-576090 Fix mem leaks and double free of signals (#2817) --- .../runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp | 3 ++- .../rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp index 4b50035093..62366e1dc5 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_blit_kernel.cpp @@ -601,7 +601,8 @@ hsa_status_t BlitKernel::Destroy() { } if (completion_signal_.handle != 0) { - HSA::hsa_signal_destroy(completion_signal_); + core::Signal* signal = core::Signal::Convert(completion_signal_); + signal->DestroySignal(); } return HSA_STATUS_SUCCESS; diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index 8f98540d0e..4cb3eb7fac 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -2470,14 +2470,12 @@ void Runtime::Unload() { asyncExceptions_.reset(); if (vm_fault_signal_ != nullptr) { - vm_fault_signal_->DestroySignal(); vm_fault_signal_.reset(); } vm_fault_event_.reset(); if (hw_exception_signal_ != nullptr) { - hw_exception_signal_->DestroySignal(); hw_exception_signal_.reset(); }