diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-02 09:04:18 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-04-02 15:28:31 -0400 |
commit | ad5b217b152d99ca3922153500c619d9758dd87a (patch) | |
tree | e0377f6f1de3394d29babe49c24a0152df18000d /tools/perf/util/session.c | |
parent | b9fb93047756c5e4129dfda7591612de61b0e877 (diff) |
perf session: Remove one more exit() call from library code
Return NULL instead and make the caller propagate the error.
LKML-Reference: <new-submission>
Cc: Frédéric Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/session.c')
-rw-r--r-- | tools/perf/util/session.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 9da5e723495c..ddf288fca3eb 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c | |||
@@ -118,16 +118,11 @@ struct map_symbol *perf_session__resolve_callchain(struct perf_session *self, | |||
118 | struct symbol **parent) | 118 | struct symbol **parent) |
119 | { | 119 | { |
120 | u8 cpumode = PERF_RECORD_MISC_USER; | 120 | u8 cpumode = PERF_RECORD_MISC_USER; |
121 | struct map_symbol *syms = NULL; | ||
122 | unsigned int i; | 121 | unsigned int i; |
122 | struct map_symbol *syms = calloc(chain->nr, sizeof(*syms)); | ||
123 | 123 | ||
124 | if (symbol_conf.use_callchain) { | 124 | if (!syms) |
125 | syms = calloc(chain->nr, sizeof(*syms)); | 125 | return NULL; |
126 | if (!syms) { | ||
127 | fprintf(stderr, "Can't allocate memory for symbols\n"); | ||
128 | exit(-1); | ||
129 | } | ||
130 | } | ||
131 | 126 | ||
132 | for (i = 0; i < chain->nr; i++) { | 127 | for (i = 0; i < chain->nr; i++) { |
133 | u64 ip = chain->ips[i]; | 128 | u64 ip = chain->ips[i]; |