riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument
authorGuo Ren <guoren@linux.alibaba.com>
Wed, 9 Nov 2022 06:49:36 +0000 (01:49 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 10:58:58 +0000 (11:58 +0100)
commit16b6d9525da60c0fc5f0a333cc500693e61ba9b3
treeb2a1b2769c47a8d0bc12b77b558c045fed39a694
parent657b440a270c094fda9fe3a35f4e183bf61c59a2
riscv: stacktrace: Fixup ftrace_graph_ret_addr retp argument

commit 5c3022e4a616d800cf5f4c3a981d7992179e44a1 upstream.

The 'retp' is a pointer to the return address on the stack, so we
must pass the current return address pointer as the 'retp'
argument to ftrace_push_return_trace(). Not parent function's
return address on the stack.

Fixes: b785ec129bd9 ("riscv/ftrace: Add HAVE_FUNCTION_GRAPH_RET_ADDR_PTR support")
Signed-off-by: Guo Ren <guoren@linux.alibaba.com>
Signed-off-by: Guo Ren <guoren@kernel.org>
Link: https://lore.kernel.org/r/20221109064937.3643993-2-guoren@kernel.org
Cc: stable@vger.kernel.org
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/riscv/kernel/stacktrace.c