Skip to content

Commit

Permalink
tracing/dynevent: Fix a memory leak in an error handling path
Browse files Browse the repository at this point in the history
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: d262271 ("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>
  • Loading branch information
Christophe JAILLET authored and Steven Rostedt (VMware) committed Apr 13, 2021
1 parent 9deb193 commit 8db403b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions kernel/trace/trace_dynevent.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8db403b

Please sign in to comment.