From: Christian Brauner Date: Wed, 17 Feb 2021 15:29:56 +0000 (+0100) Subject: cgroups: ensure that cgroup_root is initialized in legacy codepaths X-Git-Tag: lxc-5.0.0~280^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1921f351e8c399461bd0c52b2eedd10c1d43c4f;p=thirdparty%2Flxc.git cgroups: ensure that cgroup_root is initialized in legacy codepaths Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index eb722dc58..a4c12d5cf 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2143,6 +2143,9 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops, if (!cg_mount_needs_subdirs(cg_flags)) continue; + if (!cgroup_root) + cgroup_root = must_make_path(rootfs_mnt, DEFAULT_CGROUP_MOUNTPOINT, NULL); + controllerpath = must_make_path(cgroup_root, controller, NULL); if (dir_exists(controllerpath)) continue;