libhsakmt: allow gpu nodeid arrary is null and number of gpu is zero.
Allow hsaKmtRegisterGraphicsHandleToNodes parameters NodeArray be null and NumberOfNodes be zero at same time. It is the case we want the imported buffer not be registered by kfd. Set gpu_id_array = NULL explicitly to avoid free uninitialized gpuid array. Report: Yat Sin, David<David.YatSin@amd.com> Signed-off-by: Xiaogang Chen<Xiaogang.Chen@amd.com> Change-Id: I3babc1160c9573e38dd11d81965c8de2b70cae2e
Tá an tiomantas seo le fáil i:
1 tuismitheoir
7e4e57ae5f
tiomantas
f6183f937e
1 comhad athraithe
+5
-3
@@ -306,13 +306,15 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtRegisterGraphicsHandleToNodes(HSAuint64 GraphicsRe
|
||||
HSAuint32 *NodeArray)
|
||||
{
|
||||
CHECK_KFD_OPEN();
|
||||
uint32_t *gpu_id_array;
|
||||
uint32_t *gpu_id_array = NULL;
|
||||
HSAKMT_STATUS ret = HSAKMT_STATUS_SUCCESS;
|
||||
|
||||
pr_debug("[%s] number of nodes %lu\n", __func__, NumberOfNodes);
|
||||
|
||||
ret = validate_nodeid_array(&gpu_id_array,
|
||||
NumberOfNodes, NodeArray);
|
||||
if (NodeArray != NULL || NumberOfNodes != 0) {
|
||||
ret = validate_nodeid_array(&gpu_id_array,
|
||||
NumberOfNodes, NodeArray);
|
||||
}
|
||||
|
||||
if (ret == HSAKMT_STATUS_SUCCESS) {
|
||||
ret = fmm_register_graphics_handle(
|
||||
|
||||
Tagairt in Eagrán Nua
Cuir bac ar úsáideoir