mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@elte.hu>,
	Andrew Morton <akpm@linux-foundation.org>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Li Zefan <lizf@cn.fujitsu.com>
Subject: [PATCH 4/5] tracing/filters: free filter_string in destroy_preds()
Date: Tue, 16 Jun 2009 13:51:37 -0400	[thread overview]
Message-ID: <20090616175323.844879910@goodmis.org> (raw)
In-Reply-To: <20090616175133.317996432@goodmis.org>

[-- Attachment #1: 0004-tracing-filters-free-filter_string-in-destroy_preds.patch --]
[-- Type: text/plain, Size: 956 bytes --]

From: Li Zefan <lizf@cn.fujitsu.com>

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;
 }
-- 
1.6.3.1

-- 

  parent reply	other threads:[~2009-06-16 17:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 17:51 [PATCH 0/5] [GIT PULL] tracing/filters/ringbuffer: updates for 2.6.31 Steven Rostedt
2009-06-16 17:51 ` [PATCH 1/5] ring-buffer: have benchmark test handle discarded events Steven Rostedt
2009-06-16 17:51 ` [PATCH 2/5] ring-buffer: remove unused variable Steven Rostedt
2009-06-16 17:51 ` [PATCH 3/5] ring-buffer: use commit counters for commit pointer accounting Steven Rostedt
2009-06-16 17:51 ` Steven Rostedt [this message]
2009-06-16 17:51 ` [PATCH 5/5] tracing/filters: fix race between filter setting and module unload Steven Rostedt
2009-06-16 19:28 ` [PATCH 0/5] [GIT PULL] tracing/filters/ringbuffer: updates for 2.6.31 Ingo Molnar
2009-06-16 19:36   ` Ingo Molnar
2009-06-16 19:48     ` Steven Rostedt
2009-06-16 19:58       ` 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=20090616175323.844879910@goodmis.org \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizf@cn.fujitsu.com \
    --cc=mingo@elte.hu \
    /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

all inboxes | Powered by JetHome®