All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf: fix for double free in tools/perf stat
@ 2014-10-04 15:37 Yasser Shalabi
  2014-10-07  8:15 ` Namhyung Kim
  2014-10-16  5:23 ` [tip:perf/urgent] perf evlist: Fix for double free in tools/ perf stat tip-bot for Yasser Shalabi
  0 siblings, 2 replies; 4+ messages in thread
From: Yasser Shalabi @ 2014-10-04 15:37 UTC (permalink / raw)
  To: acme; +Cc: linux-kernel, mingo, paulus, a.p.zijlstra, Yasser Shalabi

Fix for double free bug in tools/perf due to dangling thread_map pointer in perf_evlist struct.
Code path excercised when perf stat -C switch is used but not set and is followed by another switch.
Example: perf stat -C -e. 
Signed-off-by: Yasser Shalabi <yassershalabi@gmail.com>

---
 tools/perf/util/evlist.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 814e954..09af633 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -845,6 +845,7 @@ int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
 
 out_delete_threads:
 	thread_map__delete(evlist->threads);
+	evlist->threads = 0;
 	return -1;
 }
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-10-16  5:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-04 15:37 [PATCH] perf: fix for double free in tools/perf stat Yasser Shalabi
2014-10-07  8:15 ` Namhyung Kim
2014-10-15 19:17   ` Arnaldo Carvalho de Melo
2014-10-16  5:23 ` [tip:perf/urgent] perf evlist: Fix for double free in tools/ perf stat tip-bot for Yasser Shalabi

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.