summaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorLi Bin <huawei.libin@huawei.com>2020-05-21 15:32:18 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2020-05-28 15:03:27 +0200
commitfa99ce828291cbbf8782284665365bc2c48e9318 (patch)
tree59dbc6298bbf1bbee60425364e86ba9a9e2378e9 /tools/perf
parentperf util: Fix memory leak of prefix_if_not_in (diff)
downloadlinux-fa99ce828291cbbf8782284665365bc2c48e9318.tar.xz
linux-fa99ce828291cbbf8782284665365bc2c48e9318.zip
perf util: Fix potential SEGFAULT in put_tracepoints_path error path
This patch fix potential segment fault triggered in put_tracepoints_path() when the address of the local variable 'path' be freed in error path of record_saved_cmdline. Signed-off-by: Li Bin <huawei.libin@huawei.com> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Hongbo Yao <yaohongbo@huawei.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Xie XiuQi <xiexiuqi@huawei.com> Link: http://lore.kernel.org/lkml/20200521133218.30150-5-liwei391@huawei.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/trace-event-info.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
index 086e98ff42a3..0e5c4786f296 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -428,7 +428,7 @@ try_id:
if (!ppath->next) {
error:
pr_debug("No memory to alloc tracepoints list\n");
- put_tracepoints_path(&path);
+ put_tracepoints_path(path.next);
return NULL;
}
next: