Skip to content

Commit 1d8f657

Browse files
zongboxpaul-walmsley-sifive
authored andcommitted
riscv: ftrace: correct the condition logic in function graph tracer
The condition should be logical NOT to assign the hook address to parent address. Because the return value 0 of function_graph_enter upon success. Fixes: e949b6d (riscv/function_graph: Simplify with function_graph_enter()) Signed-off-by: Zong Li <zong.li@sifive.com> Reviewed-by: Steven Rostedt (VMware) <rostedt@goodmis.org> Cc: stable@vger.kernel.org Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
1 parent cfda861 commit 1d8f657

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

arch/riscv/kernel/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
142142
*/
143143
old = *parent;
144144

145-
if (function_graph_enter(old, self_addr, frame_pointer, parent))
145+
if (!function_graph_enter(old, self_addr, frame_pointer, parent))
146146
*parent = return_hooker;
147147
}
148148

0 commit comments

Comments
 (0)