diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-22 10:02:16 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2016-06-22 10:02:16 -0300 |
commit | e1446551e60a7773c3acf3c55bb9449d70127882 (patch) | |
tree | 0d22b5b05ff2cd7b1ee01787a5f1474ccf057918 /tools/perf/builtin-kvm.c | |
parent | 0b04b3dcdfb9aeb0e83c8ca322bf0830ee51ce38 (diff) | |
download | lwn-e1446551e60a7773c3acf3c55bb9449d70127882.tar.gz lwn-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-kvm.c')
-rw-r--r-- | tools/perf/builtin-kvm.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/tools/perf/builtin-kvm.c b/tools/perf/builtin-kvm.c index ad46e91abec5..8f8f90e2b993 100644 --- a/tools/perf/builtin-kvm.c +++ b/tools/perf/builtin-kvm.c @@ -1426,8 +1426,7 @@ static int kvm_events_live(struct perf_kvm_stat *kvm, err = kvm_events_live_report(kvm); out: - if (kvm->session) - perf_session__delete(kvm->session); + perf_session__delete(kvm->session); kvm->session = NULL; perf_evlist__delete(kvm->evlist); |