diff --git a/runtime/mem_obj/buffer.cpp b/runtime/mem_obj/buffer.cpp index ada34e70dd..7c9484ebb1 100644 --- a/runtime/mem_obj/buffer.cpp +++ b/runtime/mem_obj/buffer.cpp @@ -128,6 +128,7 @@ Buffer *Buffer::create(Context *context, bool allocateMemory = true; bool copyMemoryFromHostPtr = false; MemoryManager *memoryManager = context->getMemoryManager(); + UNRECOVERABLE_IF(!memoryManager); GraphicsAllocation::AllocationType allocationType = getGraphicsAllocationType( properties.flags, @@ -135,8 +136,6 @@ Buffer *Buffer::create(Context *context, HwHelper::renderCompressedBuffersSupported(context->getDevice(0)->getHardwareInfo()), memoryManager->isLocalMemorySupported()); - UNRECOVERABLE_IF(!memoryManager); - checkMemory(properties.flags, size, hostPtr, errcodeRet, alignementSatisfied, copyMemoryFromHostPtr, memoryManager); if (errcodeRet != CL_SUCCESS) {