From 6a1cb59936460ff798970929f0bd52fa8da2cc00 Mon Sep 17 00:00:00 2001 From: Brice Goglin Date: Tue, 11 Feb 2014 11:30:53 +0100 Subject: [PATCH] x86: check hwloc_have_cpuid() in the backend instantiate instead of late in the discovery --- src/topology-x86.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/topology-x86.c b/src/topology-x86.c index e470eda5..d451a059 100644 --- a/src/topology-x86.c +++ b/src/topology-x86.c @@ -804,9 +804,6 @@ int hwloc_look_x86(struct hwloc_topology *topology, unsigned nbprocs, int fulldi && !(hooks.get_thisthread_cpubind && hooks.set_thisthread_cpubind)) goto out; - if (!hwloc_have_cpuid()) - goto out; - infos = calloc(nbprocs, sizeof(struct procinfo)); if (NULL == infos) goto out; @@ -953,6 +950,10 @@ hwloc_x86_component_instantiate(struct hwloc_disc_component *component, const void *_data3 __hwloc_attribute_unused) { struct hwloc_backend *backend; + + if (!hwloc_have_cpuid()) + return NULL; + backend = hwloc_backend_alloc(component); if (!backend) return NULL; -- 2.39.5