Skip to content

Commit a87d120

Browse files
committed
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
2 parents b62cef9 + 30c8fd3 commit a87d120

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

kernel/trace/trace_kprobe.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -940,8 +940,10 @@ static int __trace_kprobe_create(int argc, const char *argv[])
940940
}
941941
/* a symbol specified */
942942
symbol = kstrdup(argv[1], GFP_KERNEL);
943-
if (!symbol)
944-
return -ENOMEM;
943+
if (!symbol) {
944+
ret = -ENOMEM;
945+
goto error;
946+
}
945947

946948
tmp = strchr(symbol, '%');
947949
if (tmp) {

0 commit comments

Comments
 (0)