1 From ada770b1e74a77fff2d5f539bf6c42c25f4784db Mon Sep 17 00:00:00 2001
2 From: Max Filippov <jcmvbkbc@gmail.com>
3 Date: Thu, 4 Apr 2019 11:08:40 -0700
4 Subject: xtensa: fix return_address
6 From: Max Filippov <jcmvbkbc@gmail.com>
8 commit ada770b1e74a77fff2d5f539bf6c42c25f4784db upstream.
10 return_address returns the address that is one level higher in the call
11 stack than requested in its argument, because level 0 corresponds to its
12 caller's return address. Use requested level as the number of stack
15 This fixes the address reported by might_sleep and friends.
17 Cc: stable@vger.kernel.org
18 Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 arch/xtensa/kernel/stacktrace.c | 6 +++++-
23 1 file changed, 5 insertions(+), 1 deletion(-)
25 --- a/arch/xtensa/kernel/stacktrace.c
26 +++ b/arch/xtensa/kernel/stacktrace.c
27 @@ -272,10 +272,14 @@ static int return_address_cb(struct stac
32 + * level == 0 is for the return address from the caller of this function,
33 + * not from this function itself.
35 unsigned long return_address(unsigned level)
37 struct return_addr_data r = {
41 walk_stackframe(stack_pointer(NULL), return_address_cb, &r);