Handling for invalid event argument

Signed-off-by: Kanhaiya Singh <kanhaiya.singh@intel.com>
This commit is contained in:
Kanhaiya Singh
2020-12-22 10:52:18 +05:30
committed by Compute-Runtime-Automation
parent be7ae13911
commit 9ff19c5fbd
2 changed files with 10 additions and 0 deletions

View File

@@ -97,6 +97,9 @@ bool LinuxEventsImp::eventListen(zes_event_type_flags_t &pEvent, uint32_t timeou
}
ze_result_t LinuxEventsImp::eventRegister(zes_event_type_flags_t events) {
if (0x7fff < events) {
return ZE_RESULT_ERROR_INVALID_ENUMERATION;
}
registeredEvents = events;
if (registeredEvents & ZES_EVENT_TYPE_FLAG_MEM_HEALTH) {
memHealthAtEventRegister = currentMemHealth();