diff --git a/opal/mca/common/hwloc/hwloc/src/topology-x86.c b/opal/mca/common/hwloc/hwloc/src/topology-x86.c index 2a35f43975..ee1b1f3fb4 100644 --- a/opal/mca/common/hwloc/hwloc/src/topology-x86.c +++ b/opal/mca/common/hwloc/hwloc/src/topology-x86.c @@ -1,6 +1,6 @@ /* * Copyright © 2010-2011 INRIA. All rights reserved. - * Copyright © 2010 Université Bordeaux 1 + * Copyright © 2010-2011 Université Bordeaux 1 * Copyright © 2010-2011 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. * @@ -59,10 +59,6 @@ static void fill_amd_cache(struct procinfo *infos, unsigned level, unsigned cpui unsigned cachenum; unsigned size = 0; - cachenum = infos->numcaches++; - infos->cache = realloc(infos->cache, infos->numcaches*sizeof(*infos->cache)); - cache = &infos->cache[cachenum]; - if (level == 1) size = ((cpuid >> 24)) << 10; else if (level == 2) @@ -72,6 +68,10 @@ static void fill_amd_cache(struct procinfo *infos, unsigned level, unsigned cpui if (!size) return; + cachenum = infos->numcaches++; + infos->cache = realloc(infos->cache, infos->numcaches*sizeof(*infos->cache)); + cache = &infos->cache[cachenum]; + cache->type = 1; cache->level = level; if (level <= 2)