lkml.org 
[lkml]   [2020]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 4/4] perf util: Fix potential segment fault in put_tracepoints_path
Date
From: Li Bin <huawei.libin@huawei.com>

This patch fix potential segment fault triggerd 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>
---
tools/perf/util/trace-event-info.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

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 @@ get_tracepoints_path(struct list_head *pattrs)
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:
--
2.17.1
\
 
 \ /
  Last update: 2020-05-21 15:34    [W:0.075 / U:1.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site