Check for cgroup without controllers to prevent segfault, as the
current implementation depends upon a controller being configured.
Signed-off-by: Eric Brower <ebrower@gmail.com>
Signed-off-by: Dhaval Giani <dhaval.giani@gmail.com>
*parent = NULL;
+ /* if cgroup has no controllers attached, consider it unconfigured */
+ if (cgroup->controller[0] == NULL) {
+ cgroup_dbg("cgroup_find_parent called on unconfigured group\n");
+ return ECGFAIL;
+ }
+
pthread_rwlock_rdlock(&cg_mount_table_lock);
controller = cgroup->controller[0]->name;
if (!cg_build_path_locked(cgroup->name, child_path, controller)) {