csky: stacktrace: fix usage of ftrace_graph_ret_addr()
PATCH 1/1 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 <[email protected]>
--- arch/csky/kernel/stacktrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/csky/kernel/stacktrace.c +2 -1
@@ -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 )); } }
Signature · 1 line
2.40.1
Quoted 8 lines · Puranjay Mohan
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'swalk_stackframe()Fix this by passing a valid integer pointer to
ftrace_graph_ret_addr()Signed-off-by Puranjay Mohan <[email protected]>
LGTM, Thx!
Reviewed-by Guo Ren <[email protected]>
Quoted 28 lines
--- arch/csky/kernel/stacktrace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/csky/kernel/stacktrace.c +2
-2@@ -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
Signature · 2 lines
Best Regards Guo Ren