summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-07-11 13:03:51 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2018-07-11 13:03:51 -0700
commitc25c74b7476e27180e9b76840e963e542023f118 (patch)
treed52c9ed6428b7f45853536d6e927241b77bd2dcf /kernel
parent86125df731cb260f425b852ec0c672ac12449d31 (diff)
parent0fc8c3581dd42bc8f530314ca86db2d861485731 (diff)
downloadop-kernel-dev-c25c74b7476e27180e9b76840e963e542023f118.zip
op-kernel-dev-c25c74b7476e27180e9b76840e963e542023f118.tar.gz
Merge tag 'trace-v4.18-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull kprobe fix from Steven Rostedt: "This fixes a memory leak in the kprobe code" * tag 'trace-v4.18-rc3-2' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/kprobe: Release kprobe print_fmt properly
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_kprobe.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c
index daa8157..21f7184 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->tp.call.print_fmt);
goto error;
+ }
return &tk->tp.call;
error:
@@ -1501,6 +1503,8 @@ void destroy_local_trace_kprobe(struct trace_event_call *event_call)
}
__unregister_trace_kprobe(tk);
+
+ kfree(tk->tp.call.print_fmt);
free_trace_kprobe(tk);
}
#endif /* CONFIG_PERF_EVENTS */
OpenPOWER on IntegriCloud