wsl/libhsakmt: fix hsaKmtRegisterGraphicsHandleToNodesExt

if nodes array is nullptr

Signed-off-by: Flora Cui <flora.cui@amd.com>
Reviewed-by: Tianci Yin <tianci.yin@amd.com>
Part-of: <http://10.67.69.192/wsl/rocr-runtime/-/merge_requests/83>
This commit is contained in:
Flora Cui authored and Frank Min committed 2025-11-05 18:53:36 +08:00
1 parent 75cbeda847
commit 62aee13f7b
1 file changed
+5
+5
View File
@@ -451,6 +451,11 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtRegisterGraphicsHandleToNodesExt(HSAuint64 Graphic
HSAKMT_STATUS ret = HSAKMT_STATUS_SUCCESS;
pr_debug("number of nodes %lu\n", NumberOfNodes);
if (NumberOfNodes == 0) {
RegisterFlags.ui32.requiresVAddr = 0;
NumberOfNodes = 1;
NodeArray = (HSAuint32*)&(dxg_runtime->default_node);
}
GraphicsResourceInfo->NodeId = NodeArray[0];
return hsaKmtImportDMABufHandle(GraphicsResourceHandle,