Skip to content

Commit 11cfd81

Browse files
authored
Check if the context is init given a user has incorrectly called driver get (#351)
Signed-off-by: Neil R. Spruit <neil.r.spruit@intel.com>
1 parent 936a125 commit 11cfd81

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

source/lib/ze_libapi.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ zeDriverGet(
125125
if(ze_lib::destruction) {
126126
return ZE_RESULT_ERROR_UNINITIALIZED;
127127
}
128-
if (ze_lib::context->zeDdiTable == nullptr) {
128+
if (!ze_lib::context || ze_lib::context->zeDdiTable == nullptr) {
129129
return ZE_RESULT_ERROR_UNINITIALIZED;
130130
}
131131
static const ze_pfnDriverGet_t pfnGet = [&result] {

0 commit comments

Comments
 (0)