[PATCH 1/1] tracing/latency_hist Fix memory leak
From: Carsten Emde <hidden>
Date: 2014-02-14 17:28:14
From: Carsten Emde <hidden>
Date: 2014-02-14 17:28:14
The index_ptr memory that is allocated when printout is started currently is only returned when the printout is stopped prematurely. It is not returned when the printout regularly finishes. Fix this memory leak. Signed-off-by: Carsten Emde <redacted> Index: linux-3.12.10-rt15-somedebug/kernel/trace/latency_hist.c ===================================================================
--- linux-3.12.10-rt15-somedebug.orig/kernel/trace/latency_hist.c
+++ linux-3.12.10-rt15-somedebug/kernel/trace/latency_hist.c@@ -313,6 +313,7 @@ static void *l_next(struct seq_file *m, if (++*pos >= MAX_ENTRY_NUM) { atomic_inc(&my_hist->hist_mode); + kfree(p); return NULL; } *index_ptr = *pos;