summaryrefslogtreecommitdiffstats
path: root/tools/perf/builtin-buildid-cache.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2016-06-22 15:02:16 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2016-06-22 15:02:16 +0200
commite1446551e60a7773c3acf3c55bb9449d70127882 (patch)
tree0d22b5b05ff2cd7b1ee01787a5f1474ccf057918 /tools/perf/builtin-buildid-cache.c
parentperf evlist: Destructors should accept NULL (diff)
downloadlinux-e1446551e60a7773c3acf3c55bb9449d70127882.tar.xz
linux-e1446551e60a7773c3acf3c55bb9449d70127882.zip
perf session: Destructors should accept NULL
And do nothing, just like free(), to avoid having to test it in callers, usually in error paths. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Wang Nan <wangnan0@huawei.com> Link: http://lkml.kernel.org/n/tip-dyuupcj0hnoyt96vma8b3anv@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-buildid-cache.c')
-rw-r--r--tools/perf/builtin-buildid-cache.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/builtin-buildid-cache.c b/tools/perf/builtin-buildid-cache.c
index d75bded21fe0..2cbec658be90 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -419,8 +419,7 @@ int cmd_buildid_cache(int argc, const char **argv,
pr_warning("Couldn't add %s\n", kcore_filename);
out:
- if (session)
- perf_session__delete(session);
+ perf_session__delete(session);
return ret;
}