There can be cgroup v2 cgroup with no controllers attached to it and
while checking for enabled controllers always return true in
cgroupv2_controller_enabled() for such cgroups.
Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
if (version != CGROUP_V2)
return 0;
+ if (ctrl_name == NULL)
+ /* cgroup v2 supports cgroups with no controllers. */
+ return 0;
+
if (strncmp(cg_name, "/", strlen(cg_name)) == 0)
/*
* The root cgroup has been requested. All version 2