Browse Source

[MIPS] unwind_stack(): return ra if an exception occured at the first instruction

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Franck Bui-Huu 19 năm trước cách đây
mục cha
commit
1fd6909802
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      arch/mips/kernel/process.c

+ 5 - 2
arch/mips/kernel/process.c

@@ -465,8 +465,11 @@ unsigned long unwind_stack(struct task_struct *task, unsigned long *sp,
 
 	if (!kallsyms_lookup(pc, &size, &ofs, &modname, namebuf))
 		return 0;
-	if (ofs == 0)
-		return 0;
+	/*
+	 * Return ra if an exception occured at the first instruction
+	 */
+	if (unlikely(ofs == 0))
+		return ra;
 
 	info.func = (void *)(pc - ofs);
 	info.func_size = ofs;	/* analyze from start to ofs */