summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorBeau Belgrave <beaub@linux.microsoft.com>2022-11-23 10:32:48 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-12-31 13:32:41 +0100
commit0a022b756f74d2a783bc4e85161dd29ad9eb27f8 (patch)
treeae2906724a8bc6f6756d7a5c108e3d4f103cb79a /kernel
parente4b7d7297d374e690dde2a2737ec1e4d591bdea9 (diff)
downloadlinux-0a022b756f74d2a783bc4e85161dd29ad9eb27f8.tar.gz
linux-0a022b756f74d2a783bc4e85161dd29ad9eb27f8.tar.bz2
linux-0a022b756f74d2a783bc4e85161dd29ad9eb27f8.zip
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace_events_user.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/trace/trace_events_user.c b/kernel/trace/trace_events_user.c
index 539b08ae7020..9cb53182bb31 100644
--- a/kernel/trace/trace_events_user.c
+++ b/kernel/trace/trace_events_user.c
@@ -1359,6 +1359,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;
}