RE: [PATCH v3] lib/group_cpus: Snapshot cluster masks to keep grouping hotplug invariant

From: Guo, Wangyang

Date: Tue Aug 25 2026 - 02:44:58 EST


+ for_each_possible_cpu(cpu) {
+ if (!zalloc_cpumask_var(&snapshot[cpu], GFP_KERNEL)) {
+ while (cpu--)
for_each_possible_cpu(cpu) may have holes, but "while (cpu--)" assume the enumeration is dense.
Although freeing NULL is not a bug, it worths a comment or check for such subtle thing.
+ free_cpumask_var(snapshot[cpu]);
+ kfree(snapshot);
+ goto out;
+ }
+ }