All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@elte.hu>,
	Peter Zijlstra <peterz@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	Steven Rostedt <srostedt@redhat.com>
Subject: Re: [PATCH 2/2] rcu: trace fix possible mem-leak
Date: Fri, 1 Aug 2008 14:11:28 -0700	[thread overview]
Message-ID: <20080801211128.GF14851@linux.vnet.ibm.com> (raw)
In-Reply-To: <20080730182239.523848312@goodmis.org>

On Wed, Jul 30, 2008 at 02:20:55PM -0400, Steven Rostedt wrote:
> In the initialization of the RCU trace module, if
> rcupreempt_debugfs_init() fails, we never free the the trace buffer.
> 
> This patch frees the trace buffer in case the debugfs fails.

Looks good as well!

Reviewed-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

> Signed-off-by: Steven Rostedt <srostedt@redhat.com>
> ---
>  kernel/rcupreempt_trace.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> Index: linux-compile.git/kernel/rcupreempt_trace.c
> ===================================================================
> --- linux-compile.git.orig/kernel/rcupreempt_trace.c	2008-07-15 23:55:47.000000000 -0400
> +++ linux-compile.git/kernel/rcupreempt_trace.c	2008-07-30 13:58:41.000000000 -0400
> @@ -308,11 +308,16 @@ out:
> 
>  static int __init rcupreempt_trace_init(void)
>  {
> +	int ret;
> +
>  	mutex_init(&rcupreempt_trace_mutex);
>  	rcupreempt_trace_buf = kmalloc(RCUPREEMPT_TRACE_BUF_SIZE, GFP_KERNEL);
>  	if (!rcupreempt_trace_buf)
>  		return 1;
> -	return rcupreempt_debugfs_init();
> +	ret = rcupreempt_debugfs_init();
> +	if (ret)
> +		kfree(rcupreempt_trace_buf);
> +	return ret;
>  }
> 
>  static void __exit rcupreempt_trace_cleanup(void)
> 
> -- 

  reply	other threads:[~2008-08-01 21:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-30 18:20 [PATCH 0/2] RCU preempt updates Steven Rostedt
2008-07-30 18:20 ` [PATCH 1/2] rcu: just rename call_rcu_bh instead of making it a macro Steven Rostedt
2008-08-01 21:11   ` Paul E. McKenney
2008-08-15 15:54     ` Ingo Molnar
2008-07-30 18:20 ` [PATCH 2/2] rcu: trace fix possible mem-leak Steven Rostedt
2008-08-01 21:11   ` Paul E. McKenney [this message]
2008-08-15 15:55     ` Ingo Molnar

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=20080801211128.GF14851@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=srostedt@redhat.com \
    --cc=tglx@linutronix.de \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.