summaryrefslogtreecommitdiffstats
path: root/arch/riscv/kernel/ftrace.c
diff options
context:
space:
mode:
authorZong Li <zong.li@sifive.com>2019-12-23 09:46:13 +0100
committerPaul Walmsley <paul.walmsley@sifive.com>2020-01-03 09:56:37 +0100
commit1d8f65798240b6577d8c44d20c8ea8f1d429e495 (patch)
tree3d83f684825cbaebff1a71c225970e226768442d /arch/riscv/kernel/ftrace.c
parentriscv: dts: Add DT support for SiFive L2 cache controller (diff)
downloadlinux-1d8f65798240b6577d8c44d20c8ea8f1d429e495.tar.xz
linux-1d8f65798240b6577d8c44d20c8ea8f1d429e495.zip
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: e949b6db51dc (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>
Diffstat (limited to 'arch/riscv/kernel/ftrace.c')
-rw-r--r--arch/riscv/kernel/ftrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/riscv/kernel/ftrace.c b/arch/riscv/kernel/ftrace.c
index b94d8db5ddcc..c40fdcdeb950 100644
--- a/arch/riscv/kernel/ftrace.c
+++ b/arch/riscv/kernel/ftrace.c
@@ -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;
}