]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
tools lib traceevent: Do not reassign parg after collapse_tree()
authorSteven Rostedt <rostedt@goodmis.org>
Wed, 11 May 2016 19:09:36 +0000 (15:09 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 May 2016 00:06:53 +0000 (17:06 -0700)
commit35eb30c213ab718d1c66d44bcfda524184356250
treeb0019d20269681e9dde1734e0460ef6ed064c5a0
parent4c127a3e21daa77e437828728d40084aa428415c
tools lib traceevent: Do not reassign parg after collapse_tree()

commit 106b816cb46ebd87408b4ed99a2e16203114daa6 upstream.

At the end of process_filter(), collapse_tree() was changed to update
the parg parameter, but the reassignment after the call wasn't removed.

What happens is that the "current_op" gets modified and freed and parg
is assigned to the new allocated argument. But after the call to
collapse_tree(), parg is assigned again to the just freed "current_op",
and this causes the tool to crash.

The current_op variable must also be assigned to NULL in case of error,
otherwise it will cause it to be free()ed twice.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Fixes: 42d6194d133c ("tools lib traceevent: Refactor process_filter()")
Link: http://lkml.kernel.org/r/20160511150936.678c18a1@gandalf.local.home
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/lib/traceevent/parse-filter.c