From cafbebc2a577738f3f3cfe67f4c61dae270b1ce5 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Fri, 7 Jul 2017 21:21:03 -0500 Subject: [PATCH] Decrement hsa_init ref counter when init fails. Change-Id: If9376344d4b559e601932d070731132c8450104e [ROCm/ROCR-Runtime commit: c9f0427cb03e1795be4b058ddf201f24dcbaeb49] --- .../rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp | 1 + 1 file changed, 1 insertion(+) 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 181c4b110d..2a981ef004 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -113,6 +113,7 @@ hsa_status_t Runtime::Acquire() { hsa_status_t status = runtime_singleton_->Load(); if (status != HSA_STATUS_SUCCESS) { + runtime_singleton_->ref_count_--; return HSA_STATUS_ERROR_OUT_OF_RESOURCES; } }