VMM: return error if memory-only handle alloc fail

Return HSA_STATUS_ERROR_OUT_OF_RESOURCES if thunk call to allocate
memory handle returns NULL.

Change-Id: I6cf74f93f7d606416414ea7c2354db86aeef3137
Signed-off-by: Chris Freehill <cfreehil@amd.com>
Этот коммит содержится в:
David Yat Sin
2024-05-28 14:45:34 +00:00
коммит произвёл Chris Freehill
родитель 2e1f363d2f
Коммит beb9a42998
+2 -2
Просмотреть файл
@@ -245,9 +245,9 @@ hsa_status_t MemoryRegion::AllocateImpl(size_t& size, AllocateFlags alloc_flags,
*address = AllocateKfdMemory(kmt_alloc_flags, node_id, size);
}
if (kmt_alloc_flags.ui32.NoAddress) return HSA_STATUS_SUCCESS;
if (*address != nullptr) {
if (kmt_alloc_flags.ui32.NoAddress) return HSA_STATUS_SUCCESS;
// Commit the memory.
// For system memory, on non-restricted allocation, map it to all GPUs. On
// restricted allocation, only CPU is allowed to access by default, so