benchmarks/latmus: fix infinite loop in CPU list parser

This commit is contained in:
Philippe Gerum 2020-01-08 17:41:29 +01:00
parent ff99204ba2
commit b5ba72a91a
1 changed files with 2 additions and 1 deletions

View File

@ -1008,7 +1008,7 @@ static void parse_cpu_list(const char *path, cpu_set_t *cpuset)
p = buf;
while ((range = strtok_r(p, ",", &range_p)) != NULL) {
if (*range == '\0' || *range == '\n')
continue;
goto next;
end = -1;
id = strtok_r(range, "-", &id_r);
if (id) {
@ -1021,6 +1021,7 @@ static void parse_cpu_list(const char *path, cpu_set_t *cpuset)
for (cpu = start; cpu <= end; cpu++)
CPU_SET(cpu, cpuset);
}
next:
p = NULL;
}
out: