LKML Archive on
 help / Atom feed
* [GIT PULL][PATCH] tracing/kprobe: Release kprobe print_fmt properly
@ 2018-07-11 20:02 Steven Rostedt
  0 siblings, 0 replies; 1+ messages in thread
From: Steven Rostedt @ 2018-07-11 20:02 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: LKML, Andrew Morton, Ingo Molnar, Masami Hiramatsu, Jiri Olsa, Song Liu


This fixes a memory leak in the kprobe code.

Please pull the latest trace-v4.18-rc3-2 tree, which can be found at:


Tag SHA1: 2dc4f4a15fc23494d3fe5af7e1598923825d5da9
Head SHA1: 0fc8c3581dd42bc8f530314ca86db2d861485731

Jiri Olsa (1):
      tracing/kprobe: Release kprobe print_fmt properly

 kernel/trace/trace_kprobe.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
commit 0fc8c3581dd42bc8f530314ca86db2d861485731
Author: Jiri Olsa <>
Date:   Mon Jul 9 16:19:06 2018 +0200

    tracing/kprobe: Release kprobe print_fmt properly
    We don't release tk-> when destroying
    local uprobe. Also there's missing print_fmt kfree in
    create_local_trace_kprobe error path.
    Fixes: e12f03d7031a ("perf/core: Implement the 'perf_kprobe' PMU")
    Acked-by: Song Liu <>
    Acked-by: Masami Hiramatsu <>
    Signed-off-by: Jiri Olsa <>
    Signed-off-by: Steven Rostedt (VMware) <>

diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index daa81571b22a..21f718472942 100644
--- a/kernel/trace/trace_kprobe.c
+++ b/kernel/trace/trace_kprobe.c
@@ -1480,8 +1480,10 @@ create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
 	ret = __register_trace_kprobe(tk);
-	if (ret < 0)
+	if (ret < 0) {
+		kfree(tk->;
 		goto error;
+	}
 	return &tk->;
@@ -1501,6 +1503,8 @@ void destroy_local_trace_kprobe(struct trace_event_call *event_call)
+	kfree(tk->;
 #endif /* CONFIG_PERF_EVENTS */

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

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-11 20:02 [GIT PULL][PATCH] tracing/kprobe: Release kprobe print_fmt properly Steven Rostedt

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox