tracing: Fix memory leak in create_filter()
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Sun, 9 Dec 2018 02:10:04 +0000 (21:10 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Dec 2018 18:19:52 +0000 (19:19 +0100)
commit470cc678a12b58b449433d706703e417e8aa4921
tree00c865a3d825983f4033164e05ea3053e2272100
parentb543b5c0ac1c78c81f1ab3270d9464f6f45fd09e
tracing: Fix memory leak in create_filter()

commit b61c19209c2c35ea2a2fe502d484703686eba98c upstream.

The create_filter() calls create_filter_start() which allocates a
"parse_error" descriptor, but fails to call create_filter_finish() that
frees it.

The op_stack and inverts in predicate_parse() were also not freed.

Found by kmemleak detector.

Cc: stable@vger.kernel.org
Fixes: 80765597bc587 ("tracing: Rewrite filter logic to be simpler and faster")
Reviewed-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kernel/trace/trace_events_filter.c