aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/hist.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2019-07-04 12:13:46 -0300
committerArnaldo Carvalho de Melo <acme@redhat.com>2019-07-09 10:13:27 -0300
commite56fbc9dc79ce0fdc49ffadd062214ddd02f65b6 (patch)
treeb108e9b4fcb4cc1be29778253097089884b00f23 /tools/perf/util/hist.c
parentperf tools: Use zfree() where applicable (diff)
downloadlinux-dev-e56fbc9dc79ce0fdc49ffadd062214ddd02f65b6.tar.xz
linux-dev-e56fbc9dc79ce0fdc49ffadd062214ddd02f65b6.zip
perf tools: Use list_del_init() more thorougly
To allow for destructors to check if they're operating on a object still in a list, and to avoid going from use after free list entries into still valid, or even also other already removed from list entries. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Link: https://lkml.kernel.org/n/tip-deh17ub44atyox3j90e6rksu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to '')
-rw-r--r--tools/perf/util/hist.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 9b0ee0ef0f44..f24fd1954f6c 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -2741,10 +2741,10 @@ static void hists_evsel__exit(struct perf_evsel *evsel)
list_for_each_entry_safe(node, tmp, &hists->hpp_formats, list) {
perf_hpp_list__for_each_format_safe(&node->hpp, fmt, pos) {
- list_del(&fmt->list);
+ list_del_init(&fmt->list);
free(fmt);
}
- list_del(&node->list);
+ list_del_init(&node->list);
free(node);
}
}