From 7f91c7d92f6c33f61b19878aa01c498a212fa642 Mon Sep 17 00:00:00 2001 From: "Neil R. Spruit" Date: Fri, 20 Jun 2025 12:41:13 -0700 Subject: [PATCH] Fix missing code gen and add check in sysman device get for context Signed-off-by: Neil R. Spruit --- scripts/templates/libapi.cpp.mako | 2 +- source/lib/zes_libapi.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/templates/libapi.cpp.mako b/scripts/templates/libapi.cpp.mako index c36c9618..95844696 100644 --- a/scripts/templates/libapi.cpp.mako +++ b/scripts/templates/libapi.cpp.mako @@ -166,7 +166,7 @@ ${th.make_func_name(n, tags, obj)}( return ${X}_RESULT_ERROR_UNINITIALIZED; } %if re.match(r"\w+DriverGet$", th.make_func_name(n, tags, obj)): - if (${x}_lib::context->${n}DdiTable == nullptr) { + if (!${x}_lib::context || ${x}_lib::context->${n}DdiTable == nullptr) { return ${X}_RESULT_ERROR_UNINITIALIZED; } %endif diff --git a/source/lib/zes_libapi.cpp b/source/lib/zes_libapi.cpp index 5c0cb2e5..435dca99 100644 --- a/source/lib/zes_libapi.cpp +++ b/source/lib/zes_libapi.cpp @@ -115,7 +115,7 @@ zesDriverGet( if(ze_lib::destruction) { return ZE_RESULT_ERROR_UNINITIALIZED; } - if (ze_lib::context->zesDdiTable == nullptr) { + if (!ze_lib::context || ze_lib::context->zesDdiTable == nullptr) { return ZE_RESULT_ERROR_UNINITIALIZED; } static const zes_pfnDriverGet_t pfnGet = [&result] {