mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 17:29:14 +08:00
fix(ocl) fixing race condition in createFclTranslationCtx
In rare case of multiple threads trying to set fclBaseTranslationCtx, there was a potential for use after free (double delete) on std::unique_ptr::reset. Resolves: NEO-7767 Signed-off-by: Jaroslaw Chodor <jaroslaw.chodor@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
5b2e1f619c
commit
f7cf09d195
@@ -473,7 +473,10 @@ CIF::RAII::UPtr_t<IGC::FclOclTranslationCtxTagOCL> CompilerInterface::createFclT
|
||||
}
|
||||
|
||||
if (fclBaseTranslationCtx == nullptr) {
|
||||
fclBaseTranslationCtx = deviceCtx->CreateTranslationCtx(inType, outType);
|
||||
auto ulock = this->lock();
|
||||
if (fclBaseTranslationCtx == nullptr) {
|
||||
fclBaseTranslationCtx = deviceCtx->CreateTranslationCtx(inType, outType);
|
||||
}
|
||||
}
|
||||
|
||||
return deviceCtx->CreateTranslationCtx(inType, outType);
|
||||
|
||||
Reference in New Issue
Block a user