summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2021-04-11 12:21:54 +0200
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2021-04-13 18:29:48 +0200
commit8db403b9631331ef1d5e302cdf353c48849ca9d5 (patch)
tree11f5e5ed9f38818139a405731d05ba759ae8b693 /kernel/trace
parenttracing: Fix stack trace event size (diff)
downloadlinux-8db403b9631331ef1d5e302cdf353c48849ca9d5.tar.xz
linux-8db403b9631331ef1d5e302cdf353c48849ca9d5.zip
tracing/dynevent: Fix a memory leak in an error handling path
We must free 'argv' before returning, as already done in all the other paths of this function. Link: https://lkml.kernel.org/r/21e3594ccd7fc88c5c162c98450409190f304327.1618136448.git.christophe.jaillet@wanadoo.fr Fixes: d262271d0483 ("tracing/dynevent: Delegate parsing to create function") Acked-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'kernel/trace')
-rw-r--r--kernel/trace/trace_dynevent.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/trace/trace_dynevent.c b/kernel/trace/trace_dynevent.c
index dc971a68dda4..e57cc0870892 100644
--- a/kernel/trace/trace_dynevent.c
+++ b/kernel/trace/trace_dynevent.c
@@ -63,8 +63,10 @@ int dyn_event_release(const char *raw_command, struct dyn_event_operations *type
event = p + 1;
*p = '\0';
}
- if (event[0] == '\0')
- return -EINVAL;
+ if (event[0] == '\0') {
+ ret = -EINVAL;
+ goto out;
+ }
mutex_lock(&event_mutex);
for_each_dyn_event_safe(pos, n) {