fix: Update PlatformMonitoringTech::ioctlReadWriteData call

Update the logic to release the handle in failing cases as well.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2024-05-07 18:58:26 +00:00
committed by Compute-Runtime-Automation
parent 536698d276
commit 5052d4ac4b

View File

@@ -197,6 +197,8 @@ ze_result_t PlatformMonitoringTech::ioctlReadWriteData(std::vector<wchar_t> path
// Call DeviceIoControl
status = this->pdeviceIoControl(handle, ioctl, bufferIn, inSize, bufferOut, outSize, reinterpret_cast<unsigned long *>(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<wchar_t> path
return ZE_RESULT_ERROR_UNKNOWN;
}
this->pcloseHandle(handle);
return ZE_RESULT_SUCCESS;
}