aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/process.c')
-rw-r--r--arch/mips/kernel/process.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c
index 6829a064aac8..339870ed92f7 100644
--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -371,7 +371,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip, int *frame_size)
371static int get_frame_info(struct mips_frame_info *info) 371static int get_frame_info(struct mips_frame_info *info)
372{ 372{
373 bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS); 373 bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS);
374 union mips_instruction insn, *ip, *ip_end; 374 union mips_instruction insn, *ip;
375 const unsigned int max_insns = 128; 375 const unsigned int max_insns = 128;
376 unsigned int last_insn_size = 0; 376 unsigned int last_insn_size = 0;
377 unsigned int i; 377 unsigned int i;
@@ -384,10 +384,9 @@ static int get_frame_info(struct mips_frame_info *info)
384 if (!ip) 384 if (!ip)
385 goto err; 385 goto err;
386 386
387 ip_end = (void *)ip + info->func_size; 387 for (i = 0; i < max_insns; i++) {
388
389 for (i = 0; i < max_insns && ip < ip_end; i++) {
390 ip = (void *)ip + last_insn_size; 388 ip = (void *)ip + last_insn_size;
389
391 if (is_mmips && mm_insn_16bit(ip->halfword[0])) { 390 if (is_mmips && mm_insn_16bit(ip->halfword[0])) {
392 insn.word = ip->halfword[0] << 16; 391 insn.word = ip->halfword[0] << 16;
393 last_insn_size = 2; 392 last_insn_size = 2;