Change-Id: Ie5cdf0e69292dddc4ec0a24004b65932b0151a71
Signed-off-by: Vyacheslav Cherkashin <v.cherkashin@samsung.com>
pfg_list_rlock();
list_for_each_entry(pfg, &pfg_list, list) {
+ bool put_flag = false;
+
if (check_task_f(&pfg->filter, task) == NULL)
continue;
- if (proc == NULL)
+ if (proc == NULL) {
proc = sspt_proc_get_by_task(task);
+ put_flag = !!proc;
+ }
if (proc) {
flag = flag == PIF_NONE ? PIF_SECOND : flag;
printk(KERN_ERR "cannot create sspt_proc\n");
break;
}
+ put_flag = true;
flag = PIF_FIRST;
}
flag = flag == PIF_FIRST ? flag : PIF_ADD_PFG;
}
mutex_unlock(&proc->filters.mtx);
- sspt_proc_put(proc);
+ if (put_flag)
+ sspt_proc_put(proc);
}
}
pfg_list_runlock();