mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
fix: add unrecoverable to avoid undefined behavior
Related-To: NEO-9038 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
dcbf147a52
commit
bede264d0d
@@ -42,7 +42,9 @@ IoctlHelperPrelim20::IoctlHelperPrelim20(Drm &drmArg) : IoctlHelper(drmArg) {
|
||||
}
|
||||
if (handleExecBufferInNonBlockMode) {
|
||||
auto fileDescriptor = this->drm.getFileDescriptor();
|
||||
SysCalls::fcntl(fileDescriptor, F_SETFL, SysCalls::fcntl(fileDescriptor, F_GETFL) | O_NONBLOCK);
|
||||
auto flags = SysCalls::fcntl(fileDescriptor, F_GETFL);
|
||||
[[maybe_unused]] auto status = SysCalls::fcntl(fileDescriptor, F_SETFL, flags | O_NONBLOCK);
|
||||
DEBUG_BREAK_IF(status != 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -47,8 +47,10 @@ unsigned int getProcessId() {
|
||||
|
||||
unsigned long getNumThreads() {
|
||||
struct stat taskStat;
|
||||
stat("/proc/self/task", &taskStat);
|
||||
return taskStat.st_nlink - 2;
|
||||
if (stat("/proc/self/task", &taskStat) == 0) {
|
||||
return taskStat.st_nlink - 2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mkdir(const std::string &path) {
|
||||
|
||||
@@ -1048,7 +1048,8 @@ Wddm &WddmMemoryManager::getWddm(uint32_t rootDeviceIndex) const {
|
||||
|
||||
void *WddmMemoryManager::reserveCpuAddressRange(size_t size, uint32_t rootDeviceIndex) {
|
||||
void *reservePtr = nullptr;
|
||||
getWddm(rootDeviceIndex).reserveValidAddressRange(size, reservePtr);
|
||||
auto ret = getWddm(rootDeviceIndex).reserveValidAddressRange(size, reservePtr);
|
||||
UNRECOVERABLE_IF(!ret && reservePtr);
|
||||
return reservePtr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user