Re: [PATCH v2] profiling: don't free prof_cpu_mask on init failure
From: Tristan Madani
Date: Fri Jun 26 2026 - 11:43:34 EST
On Wed, 24 Jun 2026 18:11:13 -0700 Andrew Morton wrote:
> Confused. Current mainline has no free_cpumask_var() here?
Correct -- Tetsuo's 7c51f7bbf057 ("profiling: remove prof_cpu_mask")
removed the variable and all its references in v6.11. This patch is
for 6.1.y and 6.6.y where the old error-path free is still present.
> If we're to deliberately leak the mask here then let's have a little
> comment explaining the reasoning, so we don't later receive "profiling:
> fix memory leak" patches.
Good point. I can send v3 with:
- a comment above the return explaining the deliberate leak
- corrected Fixes tag (c309b917cab5, per Tetsuo's review)
- stable-only framing in the commit message
Alternatively, Cc stable on 7c51f7bbf057 would also fix this, though
that commit removes prof_cpu_mask entirely, adds mutex serialization
in ksysfs.c, and drops the hotplug online callback (2 files, +13/-40).
Happy to go either way.
Tristan