perf tests: Fixup return path of open-syscall-tp-fields test case
[linux-3.10.git] / tools / perf / tests / open-syscall-tp-fields.c
index 02cb741..fc5b9fc 100644 (file)
@@ -48,13 +48,13 @@ int test__syscall_open_tp_fields(void)
        err = perf_evlist__open(evlist);
        if (err < 0) {
                pr_debug("perf_evlist__open: %s\n", strerror(errno));
-               goto out_delete_evlist;
+               goto out_delete_maps;
        }
 
        err = perf_evlist__mmap(evlist, UINT_MAX, false);
        if (err < 0) {
                pr_debug("perf_evlist__mmap: %s\n", strerror(errno));
-               goto out_delete_evlist;
+               goto out_close_evlist;
        }
 
        perf_evlist__enable(evlist);
@@ -110,6 +110,10 @@ out_ok:
        err = 0;
 out_munmap:
        perf_evlist__munmap(evlist);
+out_close_evlist:
+       perf_evlist__close(evlist);
+out_delete_maps:
+       perf_evlist__delete_maps(evlist);
 out_delete_evlist:
        perf_evlist__delete(evlist);
 out: