test: cleanup usm reuse before release device res

Normally usm reuse is cleaned up before releasing device resources.

This cleanup accesses neo device. Calling it after device resources
release causes use after free.

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2025-07-17 11:39:29 +00:00
committed by Compute-Runtime-Automation
parent e652679b95
commit c925353d86

View File

@@ -4458,6 +4458,7 @@ TEST_F(DeviceTest, givenValidDeviceWhenCallingReleaseResourcesThenDirectSubmissi
auto deviceImp = static_cast<DeviceImp *>(device);
EXPECT_FALSE(neoDevice->stopDirectSubmissionCalled);
neoDevice->incRefInternal();
driverHandle->getSvmAllocsManager()->cleanupUSMAllocCaches();
deviceImp->releaseResources();
EXPECT_TRUE(neoDevice->stopDirectSubmissionCalled);
neoDevice->decRefInternal();