X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fturbostat.c;h=6995df55a550235a894f9576e848ad85d0c80e27;hb=50c2ffd12518d1040f3bd1fee343e63af9f89d3b;hp=0cf789e08ee948ceceb5c3bbc599301081a87df6;hpb=d555992d22706c732b0b4534cda0b31e24e1097a;p=collectd.git diff --git a/src/turbostat.c b/src/turbostat.c index 0cf789e0..6995df55 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -1194,8 +1194,9 @@ topology_probe() free(topology.cpus); memset(&topology, 0, sizeof(topology)); - /* Can't fail (update_max_cpu_id always returns 0) */ - assert(for_all_proc_cpus(update_max_cpu_id)); + ret = for_all_proc_cpus(update_max_cpu_id); + if (ret != 0) + goto err; topology.cpus = calloc(1, (topology.max_cpu_id + 1) * sizeof(struct cpu_topology)); if (topology.cpus == NULL) { @@ -1213,8 +1214,9 @@ topology_probe() if (ret != 0) goto err; - /* Can't fail (mark_cpu_present always returns 0) */ - assert(for_all_proc_cpus(mark_cpu_present)); + ret = for_all_proc_cpus(mark_cpu_present); + if (ret != 0) + goto err; /* * For online cpus