Validate return value of getSVMAlloc()

Change-Id: I02ad5874fa40756f200f48c26588d7a6f72c65c9
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
Maciej Dziuban
2019-07-18 10:35:42 +02:00
committed by sys_ocldev
parent c842279b7f
commit 81035485c1

View File

@@ -886,7 +886,9 @@ GraphicsAllocation *allocateGlobalsSurface(NEO::Context *ctx, NEO::Device *devic
svmProps.hostPtrReadOnly = constant;
auto ptr = ctx->getSVMAllocsManager()->createSVMAlloc(size, svmProps);
UNRECOVERABLE_IF(ptr == nullptr);
auto gpuAlloc = ctx->getSVMAllocsManager()->getSVMAlloc(ptr)->gpuAllocation;
auto svmAlloc = ctx->getSVMAllocsManager()->getSVMAlloc(ptr);
UNRECOVERABLE_IF(svmAlloc == nullptr);
auto gpuAlloc = svmAlloc->gpuAllocation;
UNRECOVERABLE_IF(gpuAlloc == nullptr);
UNRECOVERABLE_IF(device == nullptr);
device->getMemoryManager()->copyMemoryToAllocation(gpuAlloc, initData, static_cast<uint32_t>(size));