On Mon, Jul 22, 2019 at 05:14:21PM +0200, Maksym Planeta wrote: > > int rxe_init_task(void *obj, struct rxe_task *task, > - void *arg, int (*func)(void *), char *name) > + struct rxe_qp *qp, int (*func)(void *), char *name) > { > task->obj = obj; > - task->arg = arg; > + task->arg = qp; > task->func = func; > snprintf(task->name, sizeof(task->name), "%s", name); > task->destroyed = false; > > + rxe_add_ref(&qp->pelem); Please put the kref incrs near the copy of the pointer. Those things are logically related - copy the pointer, incr the kref. Jason