summaryrefslogtreecommitdiffstats
path: root/arch/xtensa/kernel/stacktrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/xtensa/kernel/stacktrace.c')
-rw-r--r--arch/xtensa/kernel/stacktrace.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/xtensa/kernel/stacktrace.c b/arch/xtensa/kernel/stacktrace.c
index 174c11f13bba..b9f82510c650 100644
--- a/arch/xtensa/kernel/stacktrace.c
+++ b/arch/xtensa/kernel/stacktrace.c
@@ -253,10 +253,14 @@ static int return_address_cb(struct stackframe *frame, void *data)
return 1;
}
+/*
+ * level == 0 is for the return address from the caller of this function,
+ * not from this function itself.
+ */
unsigned long return_address(unsigned level)
{
struct return_addr_data r = {
- .skip = level + 1,
+ .skip = level,
};
walk_stackframe(stack_pointer(NULL), return_address_cb, &r);
return r.addr;