libhsakmt: correct number of NUMA nodes calculation

numa_max_node() return the highest node number available on the current
system, number of NUMA nodes should be numa_max_node() + 1.

Change-Id: I20a6c17af071e73e853cb5ea6d0304c8aca52681
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
This commit is contained in:
Philip Yang
2019-09-16 16:22:55 -04:00
parent 69d8f2d734
commit 71cf3cf5d3
+1 -1
View File
@@ -1468,7 +1468,7 @@ static int bind_mem_to_numa(uint32_t node_id, void *mem,
if (numa_available() == -1)
return 0;
num_node = numa_max_node();
num_node = numa_max_node() + 1;
/* Ignore binding requests to invalid nodes IDs */
if (node_id >= (unsigned)num_node) {