Skip to content

Commit a58a897

Browse files
Move unrecoverable prior to pointer deference.
Change-Id: I35c33de88fd4c2286a678f250df3ff9b3b495097
1 parent a9470b9 commit a58a897

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

runtime/mem_obj/buffer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,14 @@ Buffer *Buffer::create(Context *context,
128128
bool allocateMemory = true;
129129
bool copyMemoryFromHostPtr = false;
130130
MemoryManager *memoryManager = context->getMemoryManager();
131+
UNRECOVERABLE_IF(!memoryManager);
131132

132133
GraphicsAllocation::AllocationType allocationType = getGraphicsAllocationType(
133134
properties.flags,
134135
context->isSharedContext,
135136
HwHelper::renderCompressedBuffersSupported(context->getDevice(0)->getHardwareInfo()),
136137
memoryManager->isLocalMemorySupported());
137138

138-
UNRECOVERABLE_IF(!memoryManager);
139-
140139
checkMemory(properties.flags, size, hostPtr, errcodeRet, alignementSatisfied, copyMemoryFromHostPtr, memoryManager);
141140

142141
if (errcodeRet != CL_SUCCESS) {

0 commit comments

Comments
 (0)