[FIX] check return of set_kjump_cb() for error 87/48687/1
authorVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 24 Sep 2015 18:17:04 +0000 (21:17 +0300)
committerVyacheslav Cherkashin <v.cherkashin@samsung.com>
Thu, 24 Sep 2015 18:17:04 +0000 (21:17 +0300)
Correctly process set_kjump_cb() errors.

Change-Id: I8d486e2e62f61cdd94d4aebe0eadaa9a20eabc78
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
us_manager/helper.c

index 449a107..16fd584 100644 (file)
@@ -153,8 +153,8 @@ static unsigned long cb_check_and_install(void *data);
 
 static int ctx_task_pre_handler(struct kprobe *p, struct pt_regs *regs)
 {
+       int ret;
        struct sspt_proc *proc;
-       unsigned long page_addr;
        struct task_struct *task = current;
 
        if (is_kthread(task) || check_task_on_filters(task) == 0)
@@ -164,9 +164,11 @@ static int ctx_task_pre_handler(struct kprobe *p, struct pt_regs *regs)
        if (proc && proc->first_install)
                return 0;
 
-       page_addr = 0;
+       ret = set_kjump_cb(regs, cb_check_and_install, NULL, 0);
+       if (ret < 0)
+               pr_err("ctx_task_pre_handler: ret=%d\n", ret);
 
-       return set_kjump_cb(regs, cb_check_and_install, NULL, 0);
+       return 0;
 }
 
 static struct kprobe ctx_task_kprobe = {