]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgroups: ensure that cgroup_root is initialized in legacy codepaths
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 15:29:56 +0000 (16:29 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Wed, 17 Feb 2021 15:29:56 +0000 (16:29 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index eb722dc583224f501c2ad9fb563b919c22a5a187..a4c12d5cffb6e9f9797405607147f104bcefd09c 100644 (file)
@@ -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;