public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Li Zefan <lizf@cn.fujitsu.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
	rostedt@goodmis.org, lizf@cn.fujitsu.com, tglx@linutronix.de
Subject: [tip:tracing/urgent] tracing/filters: free filter_string in destroy_preds()
Date: Wed, 17 Jun 2009 11:13:29 GMT	[thread overview]
Message-ID: <tip-57be88878e7aa38750384704d811485a607bbda4@git.kernel.org> (raw)
In-Reply-To: <4A375A30.9060802@cn.fujitsu.com>

Commit-ID:  57be88878e7aa38750384704d811485a607bbda4
Gitweb:     http://git.kernel.org/tip/57be88878e7aa38750384704d811485a607bbda4
Author:     Li Zefan <lizf@cn.fujitsu.com>
AuthorDate: Tue, 16 Jun 2009 16:39:12 +0800
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Tue, 16 Jun 2009 16:25:35 -0400

tracing/filters: free filter_string in destroy_preds()

filter->filter_string is not freed when unloading a module:

 # insmod trace-events-sample.ko
 # echo "bar < 100" > /mnt/tracing/events/sample/foo_bar/filter
 # rmmod trace-events-sample.ko

[ Impact: fix memory leak when unloading module ]

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
LKML-Reference: <4A375A30.9060802@cn.fujitsu.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


---
 kernel/trace/trace_events_filter.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c
index b24ab0e..d9f01c1 100644
--- a/kernel/trace/trace_events_filter.c
+++ b/kernel/trace/trace_events_filter.c
@@ -381,6 +381,7 @@ void destroy_preds(struct ftrace_event_call *call)
 			filter_free_pred(filter->preds[i]);
 	}
 	kfree(filter->preds);
+	kfree(filter->filter_string);
 	kfree(filter);
 	call->filter = NULL;
 }

      parent reply	other threads:[~2009-06-17 11:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16  8:39 [PATCH 1/2] tracing/filters: free filter_string in destroy_preds() Li Zefan
2009-06-16  8:39 ` [PATCH 2/2] tracing/filters: fix race between filter setting and module unload Li Zefan
2009-06-17 11:13   ` [tip:tracing/urgent] " tip-bot for Li Zefan
2009-06-17 11:13 ` tip-bot for Li Zefan [this message]

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=tip-57be88878e7aa38750384704d811485a607bbda4@git.kernel.org \
    --to=lizf@cn.fujitsu.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox