Move unrecoverable prior to pointer deference.

Change-Id: I35c33de88fd4c2286a678f250df3ff9b3b495097
This commit is contained in:
Mrozek, Michal
2019-01-09 07:55:03 +01:00
committed by sys_ocldev
parent a9470b9f79
commit a58a897bf3

View File

@@ -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) {