aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/oprofile/backtrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/oprofile/backtrace.c')
-rw-r--r--arch/mips/oprofile/backtrace.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/mips/oprofile/backtrace.c b/arch/mips/oprofile/backtrace.c
index 83a1dfd8f0e3..5e645c9a3162 100644
--- a/arch/mips/oprofile/backtrace.c
+++ b/arch/mips/oprofile/backtrace.c
@@ -65,7 +65,7 @@ static inline int is_end_of_function_marker(union mips_instruction *ip)
65 * - handle cases where the stack is adjusted inside a function 65 * - handle cases where the stack is adjusted inside a function
66 * (generally doesn't happen) 66 * (generally doesn't happen)
67 * - find optimal value for max_instr_check 67 * - find optimal value for max_instr_check
68 * - try to find a way to handle leaf functions 68 * - try to find a better way to handle leaf functions
69 */ 69 */
70 70
71static inline int unwind_user_frame(struct stackframe *old_frame, 71static inline int unwind_user_frame(struct stackframe *old_frame,
@@ -104,7 +104,7 @@ static inline int unwind_user_frame(struct stackframe *old_frame,
104 } 104 }
105 105
106 if (!ra_offset || !stack_size) 106 if (!ra_offset || !stack_size)
107 return -1; 107 goto done;
108 108
109 if (ra_offset) { 109 if (ra_offset) {
110 new_frame.ra = old_frame->sp + ra_offset; 110 new_frame.ra = old_frame->sp + ra_offset;
@@ -121,6 +121,7 @@ static inline int unwind_user_frame(struct stackframe *old_frame,
121 if (new_frame.sp > old_frame->sp) 121 if (new_frame.sp > old_frame->sp)
122 return -2; 122 return -2;
123 123
124done:
124 new_frame.pc = old_frame->ra; 125 new_frame.pc = old_frame->ra;
125 *old_frame = new_frame; 126 *old_frame = new_frame;
126 127