summaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/kprobes.c
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2013-05-22 10:34:13 +0200
committerRalf Baechle <ralf@linux-mips.org>2013-05-22 12:48:30 +0200
commit22047b85170280b0ca59ce4befd0fa1f71a4ec16 (patch)
treef8f8c3c0cea02ab234d353e4a29315f292ded065 /arch/mips/kernel/kprobes.c
parentMIPS: Idle: Break r4k_wait into two functions and fix it. (diff)
downloadlinux-22047b85170280b0ca59ce4befd0fa1f71a4ec16.tar.xz
linux-22047b85170280b0ca59ce4befd0fa1f71a4ec16.zip
kprobes/mips: Fix to check double free of insn slot
Fix to check double free of insn_slot at arch_remove_kprobe as other arches do. Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: David Daney <ddaney@caviumnetworks.com> Cc: Maneesh Soni <manesoni@cisco.com> Cc: Victor Kamensky <kamensky@cisco.com> Cc: linux-mips@linux-mips.org Cc: Ingo Molnar <mingo@redhat.com> Cc: linux-kernel@vger.kernel.org Cc: linux-mips@linux-mips.org Cc: yrl.pp-manager.tt@hitachi.com Cc: systemtap@sourceware.org Patchwork: https://patchwork.linux-mips.org/patch/5293/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/kernel/kprobes.c')
-rw-r--r--arch/mips/kernel/kprobes.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/mips/kernel/kprobes.c b/arch/mips/kernel/kprobes.c
index 12bc4ebdf55b..1f8187ab0997 100644
--- a/arch/mips/kernel/kprobes.c
+++ b/arch/mips/kernel/kprobes.c
@@ -207,7 +207,10 @@ void __kprobes arch_disarm_kprobe(struct kprobe *p)
void __kprobes arch_remove_kprobe(struct kprobe *p)
{
- free_insn_slot(p->ainsn.insn, 0);
+ if (p->ainsn.insn) {
+ free_insn_slot(p->ainsn.insn, 0);
+ p->ainsn.insn = NULL;
+ }
}
static void save_previous_kprobe(struct kprobe_ctlblk *kcb)