]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
tracing/filters: Fix memory leak when setting a filter
authorLi Zefan <lizf@cn.fujitsu.com>
Tue, 13 Oct 2009 01:28:57 +0000 (09:28 +0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 13 Oct 2009 06:05:17 +0000 (08:05 +0200)
Every time we set a filter, we leak memory allocated by
postfix_append_operand() and postfix_append_op().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
Cc: <stable@kernel.org> # for v2.6.31.x
LKML-Reference: <4AD3D7D9.4070400@cn.fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/trace/trace_events_filter.c

index 23245785927f8dfb6810313db3fcc19f3aa0d8e6..98a6cc5c64edec869176962836de406097266cab 100644 (file)
@@ -933,8 +933,9 @@ static void postfix_clear(struct filter_parse_state *ps)
 
        while (!list_empty(&ps->postfix)) {
                elt = list_first_entry(&ps->postfix, struct postfix_elt, list);
-               kfree(elt->operand);
                list_del(&elt->list);
+               kfree(elt->operand);
+               kfree(elt);
        }
 }