[PATCH 48/54] perf record: Fixup return path of cmd_record()

From: Arnaldo Carvalho de Melo
Date: Mon Mar 18 2013 - 12:26:46 EST

From: Namhyung Kim <namhyung.kim@xxxxxxx>

The error path of calling perf_target__parse_uid wrongly went to
out_free_fd. Also add missing evlist cleanup routines.

Signed-off-by: Namhyung Kim <namhyung@xxxxxxxxxx>
Cc: David Ahern <dsahern@xxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
Cc: Paul Mackerras <paulus@xxxxxxxxx>
Cc: Peter Zijlstra <a.p.zijlstra@xxxxxxxxx>
Link: http://lkml.kernel.org/r/1363326533-3310-4-git-send-email-namhyung@xxxxxxxxxx
Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
tools/perf/builtin-record.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index 80cc3ea..9f2344a 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -1028,7 +1028,7 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)
ui__error("%s", errbuf);

err = -saved_errno;
- goto out_free_fd;
+ goto out_symbol_exit;

err = -ENOMEM;
@@ -1059,6 +1059,9 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused)

err = __cmd_record(&record, argc, argv);
+ perf_evlist__munmap(evsel_list);
+ perf_evlist__close(evsel_list);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/