llvm
llvm copied to clipboard
[Coverity][UR] Potential double-unlock of a mutex in the L0 adapter
Reported by Coverity as CID 520793, you can access Coverity results here: https://scan.coverity.com/projects/intel-llvm?tab=overview
The following piece of code:
https://github.com/intel/llvm/blob/faa61805224a993f8f9de6214ba0678afc9e53e4/unified-runtime/source/adapters/level_zero/event.cpp#L1585-L1588
Is located within a loop:
https://github.com/intel/llvm/blob/faa61805224a993f8f9de6214ba0678afc9e53e4/unified-runtime/source/adapters/level_zero/event.cpp#L1552-L1553
Meaning, that we may call CurQueue->Mutex.unlock(); multiple times. That mutex is a std::shared_mutex whose unlock method behavior is undefined if a mutex is already unlocked.