Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
perf top: Fix error handling in cmd_top()
Browse files Browse the repository at this point in the history
[ Upstream commit 70c819e ]

We should go to the cleanup path, to avoid leaks, detected using gcc's
ASan.

Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: Jiri Olsa <[email protected]>
Cc: Alexei Starovoitov <[email protected]>
Cc: Daniel Borkmann <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt (VMware) <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
  • Loading branch information
changbindu authored and gregkh committed Apr 20, 2019
1 parent df894a0 commit bb644de
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/perf/builtin-top.c
Original file line number Diff line number Diff line change
Expand Up @@ -1491,8 +1491,9 @@ int cmd_top(int argc, const char **argv)
annotation_config__init();

symbol_conf.try_vmlinux_path = (symbol_conf.vmlinux_name == NULL);
if (symbol__init(NULL) < 0)
return -1;
status = symbol__init(NULL);
if (status < 0)
goto out_delete_evlist;

sort__setup_elide(stdout);

Expand Down

0 comments on commit bb644de

Please sign in to comment.