Skip to content

Commit cd7c78e

Browse files
Harishfilbranden
authored andcommitted
Fix: node_list with memory-less nodes
Patch adds check to avoid memory-less nodes while traversing till max node, and this also prevents nodes_to_use sysmalloc failure as nodes_to_use is malloc'ed with numa_num_configured_nodes which returns the number of nodes configured with memory. Signed-off-by: Harish <harish@linux.vnet.ibm.com>
1 parent 841253d commit cd7c78e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

numademo.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ void get_node_list()
307307
node_to_use = (int *)malloc(numnodes * sizeof(int));
308308
max_node = numa_max_node();
309309
for (a = 0; a <= max_node; a++) {
310-
if(numa_node_size(a, &free_node_sizes) != -1)
310+
if (numa_node_size(a, &free_node_sizes) > 0)
311311
node_to_use[got_nodes++] = a;
312312
}
313313
}

0 commit comments

Comments
 (0)