mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
tools lib traceevent: Fix a possibly wrong memory dereference
If set_op_prio() failed, the token will be freed at out_free, then arg->op.op would turn out to be a dangle pointer. After returning EVENT_ERROR from process_op(), free_arg() will be called and then it will finally see the dangling pointer. Cc: Borislav Petkov <[email protected]> Cc: David Ahern <[email protected]> Cc: Frederic Weisbecker <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Namhyung Kim <[email protected]> Signed-off-by: Steven Rostedt <[email protected]> Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
This commit is contained in:
parent
57d34dc556
commit
d1de108709
1 changed files with 2 additions and 0 deletions
|
|
@ -1715,6 +1715,8 @@ process_op(struct event_format *event, struct print_arg *arg, char **tok)
|
|||
|
||||
if (set_op_prio(arg) == -1) {
|
||||
event->flags |= EVENT_FL_FAILED;
|
||||
/* arg->op.op (= token) will be freed at out_free */
|
||||
arg->op.op = NULL;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue