Commit 2c257500 authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

boilerplate: setup: fix infinite loop in CPU list parser

Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent 0a67a85b
......@@ -178,7 +178,7 @@ static int collect_cpu_affinity(const char *cpu_list)
s = n = strdup(cpu_list);
while ((range = strtok_r(n, ",", &range_p)) != NULL) {
if (*range == '\0')
continue;
goto next;
end = -1;
if (range[strlen(range)-1] == '-')
end = nr_cpus - 1;
......@@ -203,6 +203,7 @@ static int collect_cpu_affinity(const char *cpu_list)
}
for (cpu = start; cpu <= end; cpu++)
CPU_SET(cpu, &__base_setup_data.cpu_affinity);
next:
n = NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment