Commit 8ad80731 authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar

tracing/filters: Fix memory leak when setting a filter

Every time we set a filter, we leak memory allocated by
postfix_append_operand() and postfix_append_op().
Signed-off-by: default avatarLi 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: default avatarIngo Molnar <mingo@elte.hu>
parent a813a159
...@@ -933,8 +933,9 @@ static void postfix_clear(struct filter_parse_state *ps) ...@@ -933,8 +933,9 @@ static void postfix_clear(struct filter_parse_state *ps)
while (!list_empty(&ps->postfix)) { while (!list_empty(&ps->postfix)) {
elt = list_first_entry(&ps->postfix, struct postfix_elt, list); elt = list_first_entry(&ps->postfix, struct postfix_elt, list);
kfree(elt->operand);
list_del(&elt->list); list_del(&elt->list);
kfree(elt->operand);
kfree(elt);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment