Skip to content

Commit ccc6e59

Browse files
Xiu Jianfengrostedt
authored andcommitted
tracing/user_events: Fix memory leak in user_event_create()
Before current_user_event_group(), it has allocated memory and save it in @name, this should freed before return error. Link: https://lkml.kernel.org/r/[email protected] Fixes: e5d2718 ("tracing/user_events: Move pages/locks into groups to prepare for namespaces") Signed-off-by: Xiu Jianfeng <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Acked-by: Beau Belgrave <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 0a068f4 commit ccc6e59

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kernel/trace/trace_events_user.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1100,8 +1100,10 @@ static int user_event_create(const char *raw_command)
11001100

11011101
group = current_user_event_group();
11021102

1103-
if (!group)
1103+
if (!group) {
1104+
kfree(name);
11041105
return -ENOENT;
1106+
}
11051107

11061108
mutex_lock(&group->reg_mutex);
11071109

0 commit comments

Comments
 (0)