From f1921f351e8c399461bd0c52b2eedd10c1d43c4f Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 17 Feb 2021 16:29:56 +0100 Subject: [PATCH] cgroups: ensure that cgroup_root is initialized in legacy codepaths Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.47.2