Skip to contentSkip to conversation

A blind patch:)

PATCH Songmao Tian 2 participants 2 messages Jul 30, 2007 MIPS

lore
Share & tools
lore
#0 lore raw

commit 5fabf601a53079c182d5c25f6e850d6a7bd48988 is broken. since the regptr is disappeared in the signature of the function, I think the regptr is useless.

arch/mips/kernel/unaligned.c +0 -2
index bbf20ce..1b94eef 100644
@@ -281,9 +281,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
            : "r" (addr), "i" (-EFAULT));
        if (res)
            goto fault;
-        *regptr = &regs->regs[insn.i_format.rt];
        compute_return_epc(regs);
-        *regptr = value;
        break;

#endif /* CONFIG_64BIT */

@@ -324,9 +322,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,

            : "r" (addr), "i" (-EFAULT));
        if (res)
            goto fault;
-        *regptr = &regs->regs[insn.i_format.rt];
        compute_return_epc(regs);
-        *regptr = value;
        break;

#endif /* CONFIG_64BIT */

#1 lore raw
Quoted 3 lines · Songmao Tian

commit 5fabf601a53079c182d5c25f6e850d6a7bd48988 is broken. since the regptr is disappeared in the signature of the function, I think the regptr is useless.

Indeed, you found a bug but your fix wasn't right.

Ralf

arch/mips/kernel/unaligned.c +2 -4
index bbf20ce..d34b1fb 100644
@@ -281,9 +281,8 @@ static void emulate_load_store_insn(struct pt_regs *regs,
 			: "r" (addr), "i" (-EFAULT));
 		if (res)
 			goto fault;
-		*regptr = &regs->regs[insn.i_format.rt];
 		compute_return_epc(regs);
-		*regptr = value;
+		regs->regs[insn.i_format.rt] = value;
 		break;
 #endif /* CONFIG_64BIT */
 
@@ -324,9 +323,8 @@ static void emulate_load_store_insn(struct pt_regs *regs,
 			: "r" (addr), "i" (-EFAULT));
 		if (res)
 			goto fault;
-		*regptr = &regs->regs[insn.i_format.rt];
 		compute_return_epc(regs);
-		*regptr = value;
+		regs->regs[insn.i_format.rt] = value;
 		break;
 #endif /* CONFIG_64BIT */