mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
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:

committed by
sys_ocldev

parent
9b63e8ef49
commit
c5b214e554
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user