Skip to content

Commit

Permalink
sh64: oprofile: Fix up kernel stack pointer size mismatch.
Browse files Browse the repository at this point in the history
For the backtrace code its assumed that the stack pointer is 32-bits,
which is not the case with the sh64 registers. Use the shared
kernel_stack_pointer() helper to get at the actual register, which
already takes care of the necessary typecasting.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
  • Loading branch information
Paul Mundt committed Oct 27, 2010
1 parent 2e4f17d commit d1ba71f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/sh/oprofile/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void sh_backtrace(struct pt_regs * const regs, unsigned int depth)
if (depth > backtrace_limit)
depth = backtrace_limit;

stackaddr = (unsigned long *)regs->regs[15];
stackaddr = (unsigned long *)kernel_stack_pointer(regs);
if (!user_mode(regs)) {
if (depth)
unwind_stack(NULL, regs, stackaddr,
Expand Down

0 comments on commit d1ba71f

Please sign in to comment.