All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tracing: Fix memory leak on failure path in ftrace_allocate_pages()
@ 2014-06-11  8:06 Namhyung Kim
  2014-06-11  8:06 ` [PATCH 2/2] tracing: Do not copy hash if O_TRUNC is set Namhyung Kim
  2014-06-11 14:03 ` [PATCH 1/2] tracing: Fix memory leak on failure path in ftrace_allocate_pages() Steven Rostedt
  0 siblings, 2 replies; 5+ messages in thread
From: Namhyung Kim @ 2014-06-11  8:06 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: LKML, Namhyung Kim, Namhyung Kim, Ingo Molnar

As struct ftrace_page is managed in a single linked list, it should
free from the start page.

Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 kernel/trace/ftrace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 5b372e3ed675..ddfda763ded7 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -2398,7 +2398,8 @@ ftrace_allocate_pages(unsigned long num_to_init)
 	return start_pg;
 
  free_pages:
-	while (start_pg) {
+	pg = start_pg;
+	while (pg) {
 		order = get_count_order(pg->size / ENTRIES_PER_PAGE);
 		free_pages((unsigned long)pg->records, order);
 		start_pg = pg->next;
-- 
2.0.0


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

end of thread, other threads:[~2014-06-12  1:08 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11  8:06 [PATCH 1/2] tracing: Fix memory leak on failure path in ftrace_allocate_pages() Namhyung Kim
2014-06-11  8:06 ` [PATCH 2/2] tracing: Do not copy hash if O_TRUNC is set Namhyung Kim
2014-06-11 14:05   ` Steven Rostedt
2014-06-11 14:03 ` [PATCH 1/2] tracing: Fix memory leak on failure path in ftrace_allocate_pages() Steven Rostedt
2014-06-12  1:08   ` Namhyung Kim

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.