+ found = 1;
+ break;
+ }
+ }
+
+ if (!found) {
+ /*
+ * Using zmalloc here to allocate a variable length element. Could
+ * cause some memory fragmentation if overused.
+ */
+ e = zmalloc(sizeof(struct loglevel_entry) + name_len);
+ if (!e)
+ return ERR_PTR(-ENOMEM);
+ memcpy(&e->name[0], name, name_len);
+ cds_hlist_add_head(&e->hlist, head);
+ }
+
+ /* session loglevel */
+ cds_list_for_each_entry(sl, &e->session_list, session_list) {
+ if (chan == sl->chan) {
+ DBG("loglevel %s busy for this channel", name);