On 29/07/2025 10:08 pm, Stewart Hildebrand wrote: > On 7/29/25 04:32, Jan Beulich wrote: >> On 28.07.2025 22:09, Andrew Cooper wrote: >>> On 28/07/2025 8:52 pm, Stewart Hildebrand wrote: >>>> In vcpu_create after scheduler data is allocated, if >>>> vmtrace_alloc_buffer fails, it will jump to the wrong cleanup label >>>> resulting in a memory leak. Correct the label. >>>> >>>> Fixes: 217dd79ee292 ("xen/domain: Add vmtrace_size domain creation >>>> parameter") >>>> Signed-off-by: Stewart Hildebrand <stewart.hildebr...@amd.com> >>> Urgh, sorry for breaking this. Ultimately it comes from having two >>> different error handling schemes. >>> >>> This patch is probably ok to start with (and to backport), but a better >>> fix would be to handle sched and wq in vcpu_teardown(). That way we get >>> a single failure path that does the correct thing irrespective. >> I agree, and that variant would apparently be as easily backportable. >> Stewart, are you up for going that route? > Yep, I'll give it a try
Just as a heads up before you start, the key is to ensure that anything called in *_teardown() is idempotent. ~Andrew