Re: [PATCH v3] lib/group_cpus: Snapshot cluster masks to keep grouping hotplug invariant
"Badole, Vishal" <[email protected]>
| Newsgroups | org.kernel.vger.stable,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
On 8/25/2026 12:14 PM, Guo, Wangyang wrote:
> + 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;
> + }
> + }
Thanks for the review. Sure, I will address this in the next revision.