Commit 2d8ab6ad authored by Ananth N Mavinakayanahalli's avatar Ananth N Mavinakayanahalli Committed by Linus Torvalds

[PATCH] ppc64: fix up()/down() usage for kprobe_mutex

The incorrect kprobe_mutex usage on x86_64 had percolated to ppc64 too.
First noticed by Yanmin Zhang.
Signed-off-by: default avatarAnanth N Mavinakayanahalli <ananth@in.ibm.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 702c96d5
...@@ -59,9 +59,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) ...@@ -59,9 +59,9 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
/* insn must be on a special executable page on ppc64 */ /* insn must be on a special executable page on ppc64 */
if (!ret) { if (!ret) {
up(&kprobe_mutex);
p->ainsn.insn = get_insn_slot();
down(&kprobe_mutex); down(&kprobe_mutex);
p->ainsn.insn = get_insn_slot();
up(&kprobe_mutex);
if (!p->ainsn.insn) if (!p->ainsn.insn)
ret = -ENOMEM; ret = -ENOMEM;
} }
...@@ -90,9 +90,9 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p) ...@@ -90,9 +90,9 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
void __kprobes arch_remove_kprobe(struct kprobe *p) void __kprobes arch_remove_kprobe(struct kprobe *p)
{ {
up(&kprobe_mutex);
free_insn_slot(p->ainsn.insn);
down(&kprobe_mutex); down(&kprobe_mutex);
free_insn_slot(p->ainsn.insn);
up(&kprobe_mutex);
} }
static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs) static inline void prepare_singlestep(struct kprobe *p, struct pt_regs *regs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment