From 89e8241635e4cdfcf4f261cc972107075a458cd1 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Wed, 14 May 2025 20:50:01 -0700 Subject: [PATCH] Fix sysman only init to disallow retrieval of loader context due to version compatibility - Given the static loader will no longer call the sysman apis directly, but thru the dynamic loader, split sysman drivers will be done by the dynamic loader and assignment in the static loader is not needed. - When the context read from the loader was newer than the context locally, the memory assignment was invalid causing issues. Signed-off-by: Neil R. Spruit --- source/lib/ze_lib.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source/lib/ze_lib.cpp b/source/lib/ze_lib.cpp index 2046f5fa..a470efee 100644 --- a/source/lib/ze_lib.cpp +++ b/source/lib/ze_lib.cpp @@ -174,16 +174,12 @@ namespace ze_lib // Given zesInit, then zesDrivers needs to be used as the sysmanInstanceDrivers; bool loaderContextAccessAllowed = true; #ifdef DYNAMIC_LOAD_LOADER + loaderContextAccessAllowed = false; loader::context_t *loaderContext = nullptr; - if (loaderGetContext == nullptr) { - loaderContextAccessAllowed = false; - } else { - loaderContext = loaderGetContext(); - } #else loader::context_t *loaderContext = loader::context; #endif - if (sysmanOnly && loaderContextAccessAllowed) { + if (sysmanOnly && loaderContextAccessAllowed && loaderContext != nullptr) { loaderContext->sysmanInstanceDrivers = &loaderContext->zesDrivers; }