[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240619073140.48817-1-puranjay@kernel.org>
Date: Wed, 19 Jun 2024 07:31:40 +0000
From: Puranjay Mohan <puranjay@...nel.org>
To: Guo Ren <guoren@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
linux-csky@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: puranjay12@...il.com
Subject: [PATCH] csky: stacktrace: fix usage of ftrace_graph_ret_addr()
ftrace_graph_ret_addr() now returns the passed in return address when NULL
is passed for the 'idx' paramenter. This breaks the current usage in csky's
walk_stackframe()
Fix this by passing a valid integer pointer to ftrace_graph_ret_addr()
Signed-off-by: Puranjay Mohan <puranjay@...nel.org>
---
arch/csky/kernel/stacktrace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/csky/kernel/stacktrace.c b/arch/csky/kernel/stacktrace.c
index 27ecd63e321b..1d72f18064c2 100644
--- a/arch/csky/kernel/stacktrace.c
+++ b/arch/csky/kernel/stacktrace.c
@@ -17,6 +17,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
bool (*fn)(unsigned long, void *), void *arg)
{
unsigned long fp, sp, pc;
+ int graph_idx = 0;
if (regs) {
fp = frame_pointer(regs);
@@ -50,7 +51,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,
frame = (struct stackframe *)fp;
sp = fp;
fp = frame->fp;
- pc = ftrace_graph_ret_addr(current, NULL, frame->ra,
+ pc = ftrace_graph_ret_addr(current, &graph_idx, frame->ra,
(unsigned long *)(fp - 8));
}
}
--
2.40.1
Powered by blists - more mailing lists