From 5052d4ac4bee4d5ae33d2fcd1b51848d4e92203b Mon Sep 17 00:00:00 2001 From: Filip Hazubski Date: Tue, 7 May 2024 18:58:26 +0000 Subject: [PATCH] fix: Update PlatformMonitoringTech::ioctlReadWriteData call Update the logic to release the handle in failing cases as well. Signed-off-by: Filip Hazubski --- level_zero/sysman/source/shared/windows/pmt/sysman_pmt.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/level_zero/sysman/source/shared/windows/pmt/sysman_pmt.cpp b/level_zero/sysman/source/shared/windows/pmt/sysman_pmt.cpp index 915d800d61..5c6f322ddf 100644 --- a/level_zero/sysman/source/shared/windows/pmt/sysman_pmt.cpp +++ b/level_zero/sysman/source/shared/windows/pmt/sysman_pmt.cpp @@ -197,6 +197,8 @@ ze_result_t PlatformMonitoringTech::ioctlReadWriteData(std::vector path // Call DeviceIoControl status = this->pdeviceIoControl(handle, ioctl, bufferIn, inSize, bufferOut, outSize, reinterpret_cast(sizeReturned), NULL); + this->pcloseHandle(handle); + if (status == FALSE) { NEO::printDebugString(NEO::debugManager.flags.PrintDebugMessages.get(), stderr, "deviceIoControl call failed\n"); @@ -204,8 +206,6 @@ ze_result_t PlatformMonitoringTech::ioctlReadWriteData(std::vector path return ZE_RESULT_ERROR_UNKNOWN; } - this->pcloseHandle(handle); - return ZE_RESULT_SUCCESS; }