Skip to content

Commit

Permalink
[PATCH] ppc64: fix up()/down() usage for kprobe_mutex
Browse files Browse the repository at this point in the history
The incorrect kprobe_mutex usage on x86_64 had percolated to ppc64 too.
First noticed by Yanmin Zhang.

Signed-off-by: Ananth N Mavinakayanahalli <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Ananth N Mavinakayanahalli authored and Linus Torvalds committed Oct 1, 2005
1 parent 702c96d commit 2d8ab6a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions arch/ppc64/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)

/* insn must be on a special executable page on ppc64 */
if (!ret) {
up(&kprobe_mutex);
p->ainsn.insn = get_insn_slot();
down(&kprobe_mutex);
p->ainsn.insn = get_insn_slot();
up(&kprobe_mutex);
if (!p->ainsn.insn)
ret = -ENOMEM;
}
Expand Down Expand Up @@ -90,9 +90,9 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)

void __kprobes arch_remove_kprobe(struct kprobe *p)
{
up(&kprobe_mutex);
free_insn_slot(p->ainsn.insn);
down(&kprobe_mutex);
free_insn_slot(p->ainsn.insn);
up(&kprobe_mutex);
}

static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
Expand Down

0 comments on commit 2d8ab6a

Please sign in to comment.