diff options
author | Beau Belgrave <beaub@linux.microsoft.com> | 2022-11-23 10:32:48 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-12-31 13:26:27 +0100 |
commit | b8aeaa8f0a9a495a2354d748939f66333daae23f (patch) | |
tree | ab396aa149189b48189be40aaa2897d3f6db7dd0 | |
parent | 2ea334960afcd49385840c7afd59fc5f8d3ce682 (diff) |
tracing/user_events: Fix call print_fmt leak
[ Upstream commit 4bded7af8b9af6e97514b0521004f90267905aef ]
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.
Link: https://lkml.kernel.org/r/20221123183248.554-1-beaub@linux.microsoft.com
Fixes: aa3b2b4c6692 ("user_events: Add print_fmt generation support for basic types")
Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | kernel/trace/trace_events_user.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c index a6621c52ce45..b885b6934893 100644 --- a/kernel/trace/trace_events_user.c +++ b/kernel/trace/trace_events_user.c @@ -1127,6 +1127,7 @@ put_user_lock: put_user: user_event_destroy_fields(user); user_event_destroy_validators(user); + kfree(user->call.print_fmt); kfree(user); return ret; } |