The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Tom Zanussi <tzanussi@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Li Zefan <lizf@cn.fujitsu.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [2.6.31 PATCH] tracing/filters: always free pred on filter_add_subsystem_pred() failure
Date: Sat, 08 Aug 2009 11:04:07 -0500	[thread overview]
Message-ID: <1249747447.6453.34.camel@tropicana> (raw)
In-Reply-To: <20090808160211.GM28892@elte.hu>

On Sat, 2009-08-08 at 18:02 +0200, Ingo Molnar wrote:
> * Tom Zanussi <tzanussi@gmail.com> wrote:
> 
> > If filter_add_subsystem_pred() fails due to ENOSPC or ENOMEM, the 
> > pred doesn't get freed, while as a side effect it does for other 
> > errors. Make it so the caller always frees the pred for any error.
> 
> thanks, i've queued this up for .31.
> 
> Just to make sure: tracing/core has the filter code changed 
> substantially, and this issue seems to be moot there - correct?
> 

Right, the subsystem preds are gone in tip, so nothing to fix there.

> So the total impact from both patches on -tip is the patch below - 
> right?
> 

Right.

Tom

> 	Ingo
> 
> diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
> index 27c2dbe..490337a 100644
> --- a/kernel/trace/trace_events_filter.c
> +++ b/kernel/trace/trace_events_filter.c
> @@ -1050,6 +1050,8 @@ static int replace_preds(struct event_subsystem *system,
>  
>  		pred = create_pred(elt->op, operand1, operand2);
>  add_pred:
> +		if (!pred)
> +			return -ENOMEM;
>  		if (call)
>  			err = filter_add_pred(ps, call, pred, false);
>  		else


  reply	other threads:[~2009-08-08 16:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-08 15:49 [2.6.31 PATCH] tracing/filters: always free pred on filter_add_subsystem_pred() failure Tom Zanussi
2009-08-08 16:02 ` Ingo Molnar
2009-08-08 16:04   ` Tom Zanussi [this message]
2009-08-08 16:03 ` [tip:tracing/core] tracing/filters: Always " tip-bot for Tom Zanussi

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=1249747447.6453.34.camel@tropicana \
    --to=tzanussi@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox