tracing/user_events: Fix call print_fmt leak
PATCH 1/1 tracing/user_events: Fix call print_fmt leak
If user_event_trace_register() fails within user_event_parse() the call's print_fmt member is not freed. Add kfree call to fix this.
Fixes aa3b2b4c6692 ("user_events: Add print_fmt generation support for basic types")
Signed-off-by Beau Belgrave <[email protected]>
--- kernel/trace/trace_events_user.c | 1 + 1 file changed, 1 insertion(+)
kernel/trace/trace_events_user.c +1 -0
@@ -1357,6 +1357,7 @@ static int user_event_parse(struct user_event_group *group, char *name, put_user:user_event_destroy_fields (user);user_event_destroy_validators (user); +kfree (user->call.print_fmt);kfree (user);return ret; }
Signature · 1 line
2.25.1
Quoted 5 lines · On Wed, 23 Nov 2022 10:32:48 -0800 Beau Belgrave <[email protected]>…
If
user_event_trace_register()fails withinuser_event_parse()the call'sprint_fmtmember is not freed. Add kfree call to fix this.Fixes aa3b2b4c6692 ("user_events: Add print_fmt generation support for basic types")Signed-off-by Beau Belgrave <[email protected]>
This looks good to me.
Thank you!
Quoted 19 lines
--- kernel/trace/trace_events_user.c | 1 + 1 file changed, 1 insertion(+)kernel/trace/trace_events_user.c +1
-0@@ -1357,6 +1357,7 @@ static int user_event_parse(struct user_event_group *group, char *name, put_user:user_event_destroy_fields (user);user_event_destroy_validators (user); +kfree (user->call.print_fmt);kfree (user);return ret; }Signature · 1 line
2.25.1
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>