All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] perf test x86: Fit memory leak in sample_ustack()
@ 2014-04-19 15:16 Masanari Iida
  2014-04-19 22:19 ` Jiri Olsa
  2014-04-21 14:37 ` [PATCH/v2] " Masanari Iida
  0 siblings, 2 replies; 5+ messages in thread
From: Masanari Iida @ 2014-04-19 15:16 UTC (permalink / raw)
  To: a.p.zijlstra, jolsa, paulus, mingo, acme, linux-kernel; +Cc: Masanari Iida

buf is not freed, when kernel failed to get stack map
and return.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
---
 tools/perf/arch/x86/tests/dwarf-unwind.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/tools/perf/arch/x86/tests/dwarf-unwind.c b/tools/perf/arch/x86/tests/dwarf-unwind.c
index b602ad9..68f2711 100644
--- a/tools/perf/arch/x86/tests/dwarf-unwind.c
+++ b/tools/perf/arch/x86/tests/dwarf-unwind.c
@@ -26,6 +26,7 @@ static int sample_ustack(struct perf_sample *sample,
 	map = map_groups__find(&thread->mg, MAP__FUNCTION, (u64) sp);
 	if (!map) {
 		pr_debug("failed to get stack map\n");
+		kfree(buf);
 		return -1;
 	}
 
-- 
1.9.2.468.g3f0c02a


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

end of thread, other threads:[~2014-04-23 13:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-19 15:16 [PATCH] perf test x86: Fit memory leak in sample_ustack() Masanari Iida
2014-04-19 22:19 ` Jiri Olsa
2014-04-19 22:33   ` Jiri Olsa
2014-04-21 14:37 ` [PATCH/v2] " Masanari Iida
2014-04-23 13:13   ` [tip:perf/urgent] perf tests x86: Fix " tip-bot for Masanari Iida

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.