Re: [PATCH] tracing: Free tracer resources on instance creation failure

From: Steven Rostedt

Date: Mon Oct 26 2026 - 13:12:54 EST


On Mon, 26 Oct 2026 10:53:40 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:

> > + out_free_tracers:
> > + free_tracers(tr);
> > + for (int i = 0; i < tr->nr_topts; i++)
> > + kfree(tr->topts[i].topts);
> > + kfree(tr->topts);
>
> Two minor nits:
>
> - Please declare `int i;` at the beginning of trace_array_create_systems()
> rather than inlining it inside `for (int i = 0; ...)`, matching the
> prevailing style in trace.c (e.g. in __remove_instance()).

Actually, it's now OK to do this. It used to not be (which is why the old
code doesn't do it), but I've been slowing moving to this style. And new
code may do so too.

-- Steve