static int ep_call_nested(int (*nproc)(void *, void *, int), void *priv,
void *cookie)
{
- int error;
-
- if (!ep_push_nested(cookie))
- return -1;
- /* Call the nested function */
- error = (*nproc)(priv, cookie, nesting - 1);
- nesting--;
-
- return error;
+ return (*nproc)(priv, cookie, nesting);
}
/*
struct file *child_file;
struct epitem *epi;
+ if (!ep_push_nested(cookie)) /* limits recursion */
+ return -1;
+
/* CTL_DEL can remove links here, but that can't increase our count */
rcu_read_lock();
list_for_each_entry_rcu(epi, &file->f_ep_links, fllink) {
}
}
rcu_read_unlock();
+ nesting--; /* pop */
return error;
}
struct rb_node *rbp;
struct epitem *epi;
+ if (!ep_push_nested(cookie)) /* limits recursion */
+ return -1;
+
mutex_lock_nested(&ep->mtx, call_nests + 1);
ep->gen = loop_check_gen;
for (rbp = rb_first_cached(&ep->rbr); rbp; rbp = rb_next(rbp)) {
}
}
mutex_unlock(&ep->mtx);
+ nesting--; /* pop */
return error;
}