Upgrade to 4.4.50-rt62
[kvmfornfv.git] / kernel / arch / mips / math-emu / cp1emu.c
index 32f0e19..734a2c7 100644 (file)
@@ -445,9 +445,11 @@ static int isBranchInstr(struct pt_regs *regs, struct mm_decoded_insn dec_insn,
        case spec_op:
                switch (insn.r_format.func) {
                case jalr_op:
-                       regs->regs[insn.r_format.rd] =
-                               regs->cp0_epc + dec_insn.pc_inc +
-                               dec_insn.next_pc_inc;
+                       if (insn.r_format.rd != 0) {
+                               regs->regs[insn.r_format.rd] =
+                                       regs->cp0_epc + dec_insn.pc_inc +
+                                       dec_insn.next_pc_inc;
+                       }
                        /* Fall through */
                case jr_op:
                        /* For R6, JR already emulated in jalr_op */