[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-abab9d37d2a826fcf588c5f30152dbe05c40111c@git.kernel.org>
Date: Fri, 27 Nov 2009 05:49:46 GMT
From: tip-bot for Lai Jiangshan <laijs@...fujitsu.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
fweisbec@...il.com, rostedt@...dmis.org, tglx@...utronix.de,
laijs@...fujitsu.com, mhiramat@...hat.com, mingo@...e.hu
Subject: [tip:perf/core] trace_kprobes: Fix memory leak
Commit-ID: abab9d37d2a826fcf588c5f30152dbe05c40111c
Gitweb: http://git.kernel.org/tip/abab9d37d2a826fcf588c5f30152dbe05c40111c
Author: Lai Jiangshan <laijs@...fujitsu.com>
AuthorDate: Wed, 25 Nov 2009 16:32:21 +0800
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Fri, 27 Nov 2009 06:43:04 +0100
trace_kprobes: Fix memory leak
tp->nr_args is not set before we "goto error",
it causes memory leak for free_trace_probe() use tp->nr_args
to free memory of args.
Signed-off-by: Lai Jiangshan <laijs@...fujitsu.com>
Acked-by: Masami Hiramatsu <mhiramat@...hat.com>
Cc: Steven Rostedt <rostedt@...dmis.org>
Cc: Frederic Weisbecker <fweisbec@...il.com>
LKML-Reference: <4B0CEB95.2060107@...fujitsu.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/trace/trace_kprobe.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index 79ce6a2..82e8583 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -704,10 +704,12 @@ static int create_trace_probe(int argc, char **argv)
ret = parse_probe_arg(arg, &tp->args[i].fetch, is_return);
if (ret) {
pr_info("Parse error at argument%d. (%d)\n", i, ret);
+ kfree(tp->args[i].name);
goto error;
}
+
+ tp->nr_args++;
}
- tp->nr_args = i;
ret = register_trace_probe(tp);
if (ret)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists