diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c index 065bebb4af9b..1404e8e8abf7 100644 --- a/kernel/cgroup/cgroup.c +++ b/kernel/cgroup/cgroup.c @@ -1198,6 +1198,9 @@ static struct css_set *find_css_set(struct css_set *old_cset, unsigned long key; int ssid; + if (!CGROUP_HAS_SUBSYS_CONFIG) + return NULL; + lockdep_assert_held(&cgroup_mutex); /* First see if we already have a cgroup group that matches @@ -6017,6 +6020,9 @@ int __init cgroup_init(void) struct cgroup_subsys *ss; int ssid; + if (!CGROUP_HAS_SUBSYS_CONFIG) + return -EINVAL; + BUILD_BUG_ON(CGROUP_SUBSYS_COUNT > 16); BUG_ON(cgroup_init_cftypes(NULL, cgroup_base_files)); BUG_ON(cgroup_init_cftypes(NULL, cgroup_psi_files));