perf stat: Fix up resource release order
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 1 Feb 2011 18:18:10 +0000 (16:18 -0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 1 Feb 2011 18:18:10 +0000 (16:18 -0200)
That was causing a SEGV on selected old distros.

Problem introduced in 7e2ed09.

Reported-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Cc: Tom Zanussi <tzanussi@gmail.com>
LKML-Reference: <new-submission>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-stat.c

index e0f95755361b5fcc10ac4a53fe97a6e221924a7c..806a9998fcd595bb8311f67a7d02d82168e0a5f0 100644 (file)
@@ -748,8 +748,8 @@ int cmd_stat(int argc, const char **argv, const char *prefix __used)
 out_free_fd:
        list_for_each_entry(pos, &evsel_list->entries, node)
                perf_evsel__free_stat_priv(pos);
-       perf_evlist__delete(evsel_list);
-out:
        perf_evlist__delete_maps(evsel_list);
+out:
+       perf_evlist__delete(evsel_list);
        return status;
 }