diff --git a/level_zero/core/source/device/device_imp.cpp b/level_zero/core/source/device/device_imp.cpp index bf0e1071bf..2be88dbd09 100644 --- a/level_zero/core/source/device/device_imp.cpp +++ b/level_zero/core/source/device/device_imp.cpp @@ -252,6 +252,7 @@ ze_result_t DeviceImp::createCommandList(const ze_command_list_desc_t *desc, } auto cmdList = static_cast(CommandList::fromHandle(*commandList)); + UNRECOVERABLE_IF(cmdList == nullptr); cmdList->setOrdinal(desc->commandQueueGroupOrdinal); @@ -263,7 +264,7 @@ ze_result_t DeviceImp::createCommandList(const ze_command_list_desc_t *desc, } } - if (returnValue != ZE_RESULT_SUCCESS && cmdList) { + if (returnValue != ZE_RESULT_SUCCESS) { cmdList->destroy(); cmdList = nullptr; *commandList = nullptr; diff --git a/level_zero/core/source/kernel/kernel_imp.cpp b/level_zero/core/source/kernel/kernel_imp.cpp index 11ac7fc871..11ee861739 100644 --- a/level_zero/core/source/kernel/kernel_imp.cpp +++ b/level_zero/core/source/kernel/kernel_imp.cpp @@ -1356,6 +1356,7 @@ void KernelImp::setAssertBuffer() { } void KernelImp::patchBindlessOffsetsInCrossThreadData(uint64_t bindlessSurfaceStateBaseOffset) const { + UNRECOVERABLE_IF(this->module == nullptr); auto &gfxCoreHelper = this->module->getDevice()->getGfxCoreHelper(); auto surfaceStateSize = gfxCoreHelper.getRenderSurfaceStateSize(); @@ -1385,7 +1386,7 @@ void KernelImp::patchBindlessOffsetsInCrossThreadData(uint64_t bindlessSurfaceSt } } - const auto bindlessHeapsHelper = this->module && this->module->getDevice()->getNEODevice()->getBindlessHeapsHelper(); + const auto bindlessHeapsHelper = this->module->getDevice()->getNEODevice()->getBindlessHeapsHelper(); if (!bindlessHeapsHelper) { patchBindlessOffsetsForImplicitArgs(bindlessSurfaceStateBaseOffset); diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index f174eae2d1..24642b6537 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -1713,6 +1713,7 @@ cl_int Kernel::setArgImageWithMipLevel(uint32_t argIndex, } // Sets SS structure + UNRECOVERABLE_IF(surfaceState == nullptr); if (arg.getExtendedTypeInfo().isMediaImage) { DEBUG_BREAK_IF(!kernelInfo.kernelDescriptor.kernelAttributes.flags.usesVme); pImage->setMediaImageArg(surfaceState, rootDeviceIndex); diff --git a/shared/source/os_interface/windows/wddm_residency_controller.h b/shared/source/os_interface/windows/wddm_residency_controller.h index 7c057c7a60..fadf0f0473 100644 --- a/shared/source/os_interface/windows/wddm_residency_controller.h +++ b/shared/source/os_interface/windows/wddm_residency_controller.h @@ -75,7 +75,7 @@ class WddmResidencyController { bool memoryBudgetExhausted = false; - CommandStreamReceiver *csr; + CommandStreamReceiver *csr = nullptr; ResidencyContainer filteredResidencyContainer; // Stores allocations which are not yet resident std::vector handlesForResidency; // Stores D3DKMT handles of allocations which are not yet resident