Correct validation of error returned by mmap

mmap() on error returns MAP_FAILED, which is (void *)-1,
not nullptr

Change-Id: I7ed13fbf99b4a422e2586791a3a4d76234d7e3a6
Signed-off: Gengbin Zheng <gengbin.zheng@intel.com>
Signed-off: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2020-09-13 20:38:36 -07:00
committed by sys_ocldev
parent 9b63e8ef49
commit c5b214e554

View File

@ -213,7 +213,7 @@ void *DrmMemoryManager::lockResourceInLocalMemoryImpl(BufferObject *bo) {
}
auto addr = mmapFunction(nullptr, bo->peekSize(), PROT_WRITE | PROT_READ, MAP_SHARED, getDrm(rootDeviceIndex).getFileDescriptor(), mmapOffset.offset);
DEBUG_BREAK_IF(addr == nullptr);
DEBUG_BREAK_IF(addr == MAP_FAILED);
bo->setLockedAddress(addr);