perf tests: Fixup return path of perf record test case
[linux-3.10.git] / tools / perf / tests / perf-record.c
index ffab5a4..72d8881 100644 (file)
@@ -143,7 +143,7 @@ int test__PERF_RECORD(void)
        err = perf_evlist__mmap(evlist, opts.mmap_pages, false);
        if (err < 0) {
                pr_debug("perf_evlist__mmap: %s\n", strerror(errno));
-               goto out_delete_maps;
+               goto out_close_evlist;
        }
 
        /*
@@ -306,6 +306,8 @@ found_exit:
        }
 out_err:
        perf_evlist__munmap(evlist);
+out_close_evlist:
+       perf_evlist__close(evlist);
 out_delete_maps:
        perf_evlist__delete_maps(evlist);
 out_delete_evlist: