summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorRiccardo Mancini <rickyman7@gmail.com>2021-07-15 18:07:25 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-07-28 11:13:47 +0200
commit63b823ae24cc85cf718fd08e2834d47c60554f50 (patch)
treeddc4360e77be876ee3ccbc1ff4565a9060ffc9f2 /tools
parent2ce4170c20781187ef2888a4a24b6d0cfa4c4ddf (diff)
downloadlinux-stable-63b823ae24cc85cf718fd08e2834d47c60554f50.tar.gz
linux-stable-63b823ae24cc85cf718fd08e2834d47c60554f50.tar.bz2
linux-stable-63b823ae24cc85cf718fd08e2834d47c60554f50.zip
perf probe-file: Delete namelist in del_events() on the error path
[ Upstream commit e0fa7ab42232e742dcb3de9f3c1f6127b5adc019 ] ASan reports some memory leaks when running: # perf test "42: BPF filter" This second leak is caused by a strlist not being dellocated on error inside probe_file__del_events. This patch adds a goto label before the deallocation and makes the error path jump to it. Signed-off-by: Riccardo Mancini <rickyman7@gmail.com> Fixes: e7895e422e4da63d ("perf probe: Split del_perf_probe_events()") Cc: Ian Rogers <irogers@google.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/174963c587ae77fa108af794669998e4ae558338.1626343282.git.rickyman7@gmail.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/util/probe-file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 6a6548890d5a..b67ae3b8d996 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -342,11 +342,11 @@ int probe_file__del_events(int fd, struct strfilter *filter)
ret = probe_file__get_events(fd, filter, namelist);
if (ret < 0)
- return ret;
+ goto out;
ret = probe_file__del_strlist(fd, namelist);
+out:
strlist__delete(namelist);
-
return ret;
}