mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-22 10:17:01 +08:00
Validate return value of getSVMAlloc()
Change-Id: I02ad5874fa40756f200f48c26588d7a6f72c65c9 Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
c842279b7f
commit
81035485c1
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user