cgroups: check for empty cgroups on freeze/unfreeze

parent 67ed2bd3
...@@ -2003,6 +2003,9 @@ __cgfsng_ops static bool cgfsng_freeze(struct cgroup_ops *ops) ...@@ -2003,6 +2003,9 @@ __cgfsng_ops static bool cgfsng_freeze(struct cgroup_ops *ops)
__do_fclose FILE *f = NULL; __do_fclose FILE *f = NULL;
struct hierarchy *h; struct hierarchy *h;
if (!ops->hierarchies)
return true;
if (ops->cgroup_layout != CGROUP_LAYOUT_UNIFIED) { if (ops->cgroup_layout != CGROUP_LAYOUT_UNIFIED) {
h = get_hierarchy(ops, "freezer"); h = get_hierarchy(ops, "freezer");
if (!h) if (!h)
...@@ -2054,6 +2057,9 @@ __cgfsng_ops static bool cgfsng_unfreeze(struct cgroup_ops *ops) ...@@ -2054,6 +2057,9 @@ __cgfsng_ops static bool cgfsng_unfreeze(struct cgroup_ops *ops)
__do_free char *fullpath = NULL; __do_free char *fullpath = NULL;
struct hierarchy *h; struct hierarchy *h;
if (!ops->hierarchies)
return true;
if (ops->cgroup_layout != CGROUP_LAYOUT_UNIFIED) { if (ops->cgroup_layout != CGROUP_LAYOUT_UNIFIED) {
h = get_hierarchy(ops, "freezer"); h = get_hierarchy(ops, "freezer");
if (!h) if (!h)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment