diff options
-rw-r--r-- | arch/arm/kernel/kprobes-decode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/arm/kernel/kprobes-decode.c b/arch/arm/kernel/kprobes-decode.c index c24e21ec427f..348ff47acd06 100644 --- a/arch/arm/kernel/kprobes-decode.c +++ b/arch/arm/kernel/kprobes-decode.c | |||
@@ -883,11 +883,12 @@ emulate_alu_tests(struct kprobe *p, struct pt_regs *regs) | |||
883 | static enum kprobe_insn __kprobes | 883 | static enum kprobe_insn __kprobes |
884 | prep_emulate_ldr_str(kprobe_opcode_t insn, struct arch_specific_insn *asi) | 884 | prep_emulate_ldr_str(kprobe_opcode_t insn, struct arch_specific_insn *asi) |
885 | { | 885 | { |
886 | int ibit = (insn & (1 << 26)) ? 25 : 22; | 886 | int not_imm = (insn & (1 << 26)) ? (insn & (1 << 25)) |
887 | : (~insn & (1 << 22)); | ||
887 | 888 | ||
888 | insn &= 0xfff00fff; | 889 | insn &= 0xfff00fff; |
889 | insn |= 0x00001000; /* Rn = r0, Rd = r1 */ | 890 | insn |= 0x00001000; /* Rn = r0, Rd = r1 */ |
890 | if (insn & (1 << ibit)) { | 891 | if (not_imm) { |
891 | insn &= ~0xf; | 892 | insn &= ~0xf; |
892 | insn |= 2; /* Rm = r2 */ | 893 | insn |= 2; /* Rm = r2 */ |
893 | } | 894 | } |