diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2025-01-11 20:34:12 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2025-01-11 20:34:12 -0800 |
| commit | a87d1203bb232a2bec674879b62f87322b20c2c8 (patch) | |
| tree | 7a2430dd811b722d74b4c4c50433d1034764445c | |
| parent | b62cef9a5c673f1b8083159f5dc03c1c5daced2f (diff) | |
| parent | 30c8fd31c571db486a5331a92d03eb60a0fb277c (diff) | |
Merge tag 'probes-fixes-v6.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace
Pull probes fix from Masami Hiramatsu:
"Fix to free trace_kprobe objects at a failure path in
__trace_kprobe_create() function. This fixes a memory leak"
* tag 'probes-fixes-v6.13-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
tracing/kprobes: Fix to free objects when failed to copy a symbol
| -rw-r--r-- | kernel/trace/trace_kprobe.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 935a886af40c..0642ea174849 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c @@ -940,8 +940,10 @@ static int __trace_kprobe_create(int argc, const char *argv[]) } /* a symbol specified */ symbol = kstrdup(argv[1], GFP_KERNEL); - if (!symbol) - return -ENOMEM; + if (!symbol) { + ret = -ENOMEM; + goto error; + } tmp = strchr(symbol, '%'); if (tmp) { |
