aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/kprobes.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kprobes.c')
-rw-r--r--kernel/kprobes.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index d0493eafea3e..7a86e6432338 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -699,6 +699,12 @@ static int __kprobes pre_handler_kretprobe(struct kprobe *p,
699 struct kretprobe_instance, uflist); 699 struct kretprobe_instance, uflist);
700 ri->rp = rp; 700 ri->rp = rp;
701 ri->task = current; 701 ri->task = current;
702
703 if (rp->entry_handler && rp->entry_handler(ri, regs)) {
704 spin_unlock_irqrestore(&kretprobe_lock, flags);
705 return 0;
706 }
707
702 arch_prepare_kretprobe(ri, regs); 708 arch_prepare_kretprobe(ri, regs);
703 709
704 /* XXX(hch): why is there no hlist_move_head? */ 710 /* XXX(hch): why is there no hlist_move_head? */
@@ -745,7 +751,8 @@ int __kprobes register_kretprobe(struct kretprobe *rp)
745 INIT_HLIST_HEAD(&rp->used_instances); 751 INIT_HLIST_HEAD(&rp->used_instances);
746 INIT_HLIST_HEAD(&rp->free_instances); 752 INIT_HLIST_HEAD(&rp->free_instances);
747 for (i = 0; i < rp->maxactive; i++) { 753 for (i = 0; i < rp->maxactive; i++) {
748 inst = kmalloc(sizeof(struct kretprobe_instance), GFP_KERNEL); 754 inst = kmalloc(sizeof(struct kretprobe_instance) +
755 rp->data_size, GFP_KERNEL);
749 if (inst == NULL) { 756 if (inst == NULL) {
750 free_rp_inst(rp); 757 free_rp_inst(rp);
751 return -ENOMEM; 758 return -ENOMEM;