Skip to content

Commit

Permalink
riscv: ftrace: correct the condition logic in function graph tracer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Zong Li authored and Paul Walmsley committed Jan 3, 2020
1 parent cfda861 commit 1d8f657
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/riscv/kernel/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr,
*/
old = *parent;

if (function_graph_enter(old, self_addr, frame_pointer, parent))
if (!function_graph_enter(old, self_addr, frame_pointer, parent))
*parent = return_hooker;
}

Expand Down

0 comments on commit 1d8f657

Please sign in to comment.