Re: [PATCH 2/2] tracing: Add free_trace_iter_content() helper function

From: Steven Rostedt
Date: Fri Jul 14 2023 - 10:22:24 EST


On Fri, 14 Jul 2023 17:47:57 +0900
Masami Hiramatsu (Google) <mhiramat@xxxxxxxxxx> wrote:

> > @@ -6709,7 +6723,12 @@ static int tracing_open_pipe(struct inode *inode, struct file *filp)
> > }
> >
> > trace_seq_init(&iter->seq);
> > - iter->trace = tr->current_trace;
> > +
> > + iter->trace = kzalloc(sizeof(*iter->trace), GFP_KERNEL);
> > + if (!iter->trace)
> > + goto fail;
> > +
> > + *iter->trace = *tr->current_trace;
>
> Hmm, you allocate iter->trace here (again)

Bah, that looks like it got out of sync with the previous patch (which
removed that). That's not suppose to be there.

I'll fix this an send out a v2. Thanks for catching that!

-- Steve