]> Gentwo Git Trees - linux/.git/commitdiff
ftrace: Avoid redundant initialization in register_ftrace_direct
authorMenglong Dong <menglong8.dong@gmail.com>
Mon, 10 Nov 2025 12:18:08 +0000 (20:18 +0800)
committerSteven Rostedt (Google) <rostedt@goodmis.org>
Wed, 26 Nov 2025 20:13:28 +0000 (15:13 -0500)
The FTRACE_OPS_FL_INITIALIZED flag is cleared in register_ftrace_direct,
which can make it initialized by ftrace_ops_init() even if it is already
initialized. It seems that there is no big deal here, but let's still fix
it.

Link: https://patch.msgid.link/20251110121808.1559240-1-dongml2@chinatelecom.cn
Fixes: f64dd4627ec6 ("ftrace: Add multi direct register/unregister interface")
Acked-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
kernel/trace/ftrace.c

index 7c3bbebeec7a818f27f037e5192164c2e0311201..b4510a6dbf42637c14eec4fcf8791cde4038349b 100644 (file)
@@ -6069,7 +6069,7 @@ int register_ftrace_direct(struct ftrace_ops *ops, unsigned long addr)
        new_hash = NULL;
 
        ops->func = call_direct_funcs;
-       ops->flags = MULTI_FLAGS;
+       ops->flags |= MULTI_FLAGS;
        ops->trampoline = FTRACE_REGS_ADDR;
        ops->direct_call = addr;