Return nullptr for gfx alloc mmap error

Signed-off-by: John Falkowski <john.falkowski@intel.com>
This commit is contained in:
John Falkowski
2022-04-11 03:40:18 +00:00
committed by Compute-Runtime-Automation
parent ee0d183cf9
commit 789587bacc
4 changed files with 74 additions and 7 deletions

View File

@ -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;
}