Skip to content

Commit

Permalink
freebsd: fix the management of failures to allocate nodes
Browse files Browse the repository at this point in the history
This completes commit 3490edd

Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr>
  • Loading branch information
bgoglin committed Dec 12, 2019
1 parent 3490edd commit fa6de97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hwloc/topology-freebsd.c
Expand Up @@ -416,16 +416,18 @@ hwloc_look_freebsd_domains(struct hwloc_topology *topology){

obj->attr->numanode.local_memory = domains_memory[i];

nodes[i] = obj;
if (nodes)
nodes[i] = obj;
hwloc_insert_object_by_cpuset(topology, obj);
} else {
free(nodes);
nodes = NULL;
}
}
if(nodes != NULL)
set_locality_info(topology, ndomains, nodes);

/*nodes is either free in set_locality_info() or sent to the kernel to set locality info*/
/* nodes is either freed or given to the core in set_locality_info() */
free(domains_memory);

topology->support.discovery->numa = 1;
Expand Down

0 comments on commit fa6de97

Please sign in to comment.