summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2021-04-13 18:40:00 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2021-04-13 18:40:00 -0700
commit50987beca096a7ed4f453a6da245fd6a2fadedeb (patch)
tree4dd912eeded6cc698d02850050b04dad450d77c1 /kernel
parenteebe426d32e1a10ac7c35f8ffab5f818c32a2454 (diff)
parent8db403b9631331ef1d5e302cdf353c48849ca9d5 (diff)
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')
-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) {