s390/kprobes: have more correct if statement in s390_get_insn_slot()
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 2 Sep 2013 08:31:11 +0000 (10:31 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 24 Oct 2013 15:16:45 +0000 (17:16 +0200)
When checking the insn address wether it is a kernel image or module
address it should be an if-else-if statement not two independent if
statements.
This doesn't really fix a bug, but matches s390_free_insn_slot().

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/kprobes.c

index d86e64eddb42efdedf44078cc8e29a51247eba87..9f99ad7fc212f50cfd68d1008fc1275d26ff4116 100644 (file)
@@ -252,7 +252,7 @@ static int __kprobes s390_get_insn_slot(struct kprobe *p)
        p->ainsn.insn = NULL;
        if (is_kernel_addr(p->addr))
                p->ainsn.insn = get_dmainsn_slot();
-       if (is_module_addr(p->addr))
+       else if (is_module_addr(p->addr))
                p->ainsn.insn = get_insn_slot();
        return p->ainsn.insn ? 0 : -ENOMEM;
 }