mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 14:02:58 +08:00
fix: zesInit switch crash
The fix is provided to detect validity of sysman device handle in sysman APIs. It can detect core device handle when passed instead of sysman device handle in zesInit path and return error code. Related-To: NEO-12690 Signed-off-by: Shreyas Kunder <shreyas.kunder@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
92b34f3b2c
commit
f52f9753ed
@@ -153,6 +153,9 @@ ze_result_t LinuxEventsUtil::eventsListen(uint64_t timeout, uint32_t count, zes_
|
||||
std::vector<zes_event_type_flags_t> registeredEvents(count);
|
||||
for (uint32_t devIndex = 0; devIndex < count; devIndex++) {
|
||||
auto device = static_cast<SysmanDeviceImp *>(L0::Sysman::SysmanDevice::fromHandle(phDevices[devIndex]));
|
||||
if (device == nullptr) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
eventsMutex.lock();
|
||||
if (deviceEventsMap.find(device) != deviceEventsMap.end()) {
|
||||
registeredEvents[devIndex] = deviceEventsMap[device];
|
||||
|
||||
Reference in New Issue
Block a user