[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140610115852.0034a678@gandalf.local.home>
Date:	Tue, 10 Jun 2014 11:58:52 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Namhyung Kim <namhyung@...il.com>
Cc:	linux-kernel@...r.kernel.org, Ingo Molnar <mingo@...nel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Yoshihiro YUNOMAE <yoshihiro.yunomae.ez@...achi.com>
Subject: Re: [for-next][PATCH 6/6] tracing: Fix leak of ring buffer data
 when new instances creation fails
On Tue, 10 Jun 2014 14:25:21 +0900
Namhyung Kim <namhyung@...il.com> wrote:
 
> > +static void free_trace_buffers(struct trace_array *tr)
> > +{
> > +	if (!tr)
> > +		return;
> > +
> > +	if (tr->trace_buffer.buffer) {
> > +		ring_buffer_free(tr->trace_buffer.buffer);
> > +		tr->trace_buffer.buffer = NULL;
> > +		free_percpu(tr->trace_buffer.data);
> > +	}
> > +
> > +#ifdef CONFIG_TRACER_MAX_TRACE
> > +	if (tr->max_buffer.buffer) {
> > +		ring_buffer_free(tr->max_buffer.buffer);
> > +		tr->max_buffer.buffer = NULL;
> 
> Hmm.. why doesn't it free tr->max_buffer.data here?  And I think it's
> better to reset *_buffer.data to NULL also - maybe by adding another
> helper function free_trace_buffer()..
> 
Originally, instances didn't need them. But I'm looking now and yes
they do allocate. I guess this doesn't trigger kmem-leak checks, as I
ran creation and deletions with that running and it didn't report any
leaks.
I'll update,
Thanks!
-- Steve
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Powered by blists - more mailing lists
 
