All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Namhyung Kim <namhyung.kim@lge.com>,
	Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH 1/2] tracing: Fix memory leak on failure path in ftrace_allocate_pages()
Date: Wed, 11 Jun 2014 10:03:40 -0400	[thread overview]
Message-ID: <20140611100340.76b61805@gandalf.local.home> (raw)
In-Reply-To: <1402474014-28655-1-git-send-email-namhyung@kernel.org>

On Wed, 11 Jun 2014 17:06:53 +0900
Namhyung Kim <namhyung@kernel.org> wrote:

> As struct ftrace_page is managed in a single linked list, it should
> free from the start page.
> 
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  kernel/trace/ftrace.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 5b372e3ed675..ddfda763ded7 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -2398,7 +2398,8 @@ ftrace_allocate_pages(unsigned long num_to_init)
>  	return start_pg;
>  
>   free_pages:
> -	while (start_pg) {
> +	pg = start_pg;
> +	while (pg) {

It works with just the added "pg = start_page", I would keep the
while (start_pg) still.

-- Steve

>  		order = get_count_order(pg->size / ENTRIES_PER_PAGE);
>  		free_pages((unsigned long)pg->records, order);
>  		start_pg = pg->next;


  parent reply	other threads:[~2014-06-11 14:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11  8:06 Namhyung Kim
2014-06-11  8:06 ` [PATCH 2/2] tracing: Do not copy hash if O_TRUNC is set Namhyung Kim
2014-06-11 14:05   ` Steven Rostedt
2014-06-11 14:03 ` Steven Rostedt [this message]
2014-06-12  1:08   ` [PATCH 1/2] tracing: Fix memory leak on failure path in ftrace_allocate_pages() Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140611100340.76b61805@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung.kim@lge.com \
    --cc=namhyung@kernel.org \
    --subject='Re: [PATCH 1/2] tracing: Fix memory leak on failure path in ftrace_allocate_pages()' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.