Skip to content

Commit

Permalink
tracing/filters: Fix memory leak when setting a filter
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Li Zefan authored and Ingo Molnar committed Oct 13, 2009
1 parent a813a15 commit 8ad8073
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion kernel/trace/trace_events_filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 8ad8073

Please sign in to comment.