From: Vyacheslav Cherkashin Date: Mon, 7 Apr 2014 10:27:42 +0000 (+0400) Subject: [FIX] add uretprobe null check (ri->rp) X-Git-Tag: Tizen_SDK_2.3~92 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2667ddc2717adbe7297c6a5cc74266804bc17bbe;p=kernel%2Fswap-modules.git [FIX] add uretprobe null check (ri->rp) in trampoline_uprobe_handler() Change-Id: I5d6d7935f369349f06bcc864bd82f15ca862d217 Signed-off-by: Vyacheslav Cherkashin --- diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c index 393811f..3792476 100644 --- a/uprobe/swap_uprobes.c +++ b/uprobe/swap_uprobes.c @@ -619,6 +619,7 @@ void dbi_unregister_ujprobe(struct ujprobe *jp) int trampoline_uprobe_handler(struct kprobe *p, struct pt_regs *regs) { struct uretprobe_instance *ri = NULL; + struct kprobe *kp; struct hlist_head *head; unsigned long flags, tramp_addr, orig_ret_addr = 0; struct hlist_node *tmp; @@ -648,14 +649,18 @@ int trampoline_uprobe_handler(struct kprobe *p, struct pt_regs *regs) continue; } - if (ri->rp && ri->rp->handler) { - ri->rp->handler(ri, regs); + kp = NULL; + if (ri->rp) { + kp = up2kp(&ri->rp->up); + + if (ri->rp->handler) + ri->rp->handler(ri, regs); } orig_ret_addr = (unsigned long)ri->ret_addr; recycle_urp_inst(ri); - if (orig_ret_addr != tramp_addr && &ri->rp->up.kp == p) { + if ((orig_ret_addr != tramp_addr && kp == p) || kp == NULL) { /* * This is the real return address. Any other * instances associated with this task are for