mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Return nullptr for gfx alloc mmap error
Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
ee0d183cf9
commit
789587bacc
@ -491,6 +491,11 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemoryInPreferredPool(const A
|
||||
this->registerSysMemAlloc(allocation);
|
||||
}
|
||||
}
|
||||
|
||||
if (!allocation) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FileLoggerInstance().logAllocation(allocation);
|
||||
registerAllocationInOs(allocation);
|
||||
return allocation;
|
||||
@ -647,6 +652,11 @@ void *MemoryManager::lockResource(GraphicsAllocation *graphicsAllocation) {
|
||||
return graphicsAllocation->getLockedPtr();
|
||||
}
|
||||
auto retVal = lockResourceImpl(*graphicsAllocation);
|
||||
|
||||
if (!retVal) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
graphicsAllocation->lock(retVal);
|
||||
return retVal;
|
||||
}
|
||||
|
Reference in New Issue
Block a user