summaryrefslogtreecommitdiffstats
path: root/tools/perf/pmu-events
diff options
context:
space:
mode:
authorLike Xu <likexu@tencent.com>2021-09-28 18:29:38 +0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2021-10-05 14:48:10 -0300
commitb94729919db2c6737501c36ea6526a36d5d63fa2 (patch)
tree8660ba1ef06c6eb9911d0c7976f3a9d6e3986b69 /tools/perf/pmu-events
parentf6274b06e326d8471cdfb52595f989a90f5e888f (diff)
downloadlinux-stable-b94729919db2c6737501c36ea6526a36d5d63fa2.tar.gz
linux-stable-b94729919db2c6737501c36ea6526a36d5d63fa2.tar.bz2
linux-stable-b94729919db2c6737501c36ea6526a36d5d63fa2.zip
perf jevents: Free the sys_event_tables list after processing entries
The compiler reports that free_sys_event_tables() is dead code. But according to the semantics, the "LIST_HEAD(sys_event_tables)" should also be released, just like we do with 'arch_std_events' in main(). Fixes: e9d32c1bf0cd7a98 ("perf vendor events: Add support for arch standard events") Signed-off-by: Like Xu <likexu@tencent.com> Reviewed-by: John Garry <john.garry@huawei.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lore.kernel.org/lkml/20210928102938.69681-1-likexu@tencent.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/pmu-events')
-rw-r--r--tools/perf/pmu-events/jevents.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index 6731b3cf0c2f..7c887d37b893 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -1285,6 +1285,7 @@ int main(int argc, char *argv[])
}
free_arch_std_events();
+ free_sys_event_tables();
free(mapfile);
return 0;
@@ -1306,6 +1307,7 @@ err_close_eventsfp:
create_empty_mapping(output_file);
err_out:
free_arch_std_events();
+ free_sys_event_tables();
free(mapfile);
return ret;
}