summaryrefslogtreecommitdiffstats
path: root/kernel/trace
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-04-14 03:40:00 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-14 03:40:00 +0200
commit50987beca096a7ed4f453a6da245fd6a2fadedeb (patch)
tree4dd912eeded6cc698d02850050b04dad450d77c1 /kernel/trace
parentMerge tag 'fixes-for-5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff)
parenttracing/dynevent: Fix a memory leak in an error handling path (diff)
downloadlinux-50987beca096a7ed4f453a6da245fd6a2fadedeb.tar.xz
linux-50987beca096a7ed4f453a6da245fd6a2fadedeb.zip
Merge tag 'trace-v5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fix from Steven Rostedt: "Fix a memory link in dyn_event_release(). An error path exited the function before freeing the allocated 'argv' variable" * tag 'trace-v5.12-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/dynevent: Fix a memory leak in an error handling path
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) {