From 84d7a4970a6e094a0648a0d1d60d10389b71fad3 Mon Sep 17 00:00:00 2001 From: aarongreig Date: Fri, 19 Apr 2024 10:35:14 +0100 Subject: [PATCH] Merge pull request #1517 from nrspruit/fix_l0_coverity_sync [L0] Store LastCommandEvent before unlock during queue sync --- source/adapters/level_zero/queue.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/adapters/level_zero/queue.cpp b/source/adapters/level_zero/queue.cpp index 03c6c46651..e21e4e1b0a 100644 --- a/source/adapters/level_zero/queue.cpp +++ b/source/adapters/level_zero/queue.cpp @@ -1635,8 +1635,9 @@ ur_result_t ur_queue_handle_t_::synchronize() { // event. if (isInOrderQueue() && !LastCommandEvent->IsDiscarded) { if (UrL0QueueSyncNonBlocking) { + auto SyncZeEvent = LastCommandEvent->ZeEvent; this->Mutex.unlock(); - ZE2UR_CALL(zeHostSynchronize, (LastCommandEvent->ZeEvent)); + ZE2UR_CALL(zeHostSynchronize, (SyncZeEvent)); this->Mutex.lock(); } else { ZE2UR_CALL(zeHostSynchronize, (LastCommandEvent->ZeEvent));