From: Christian Brauner Date: Sat, 7 Dec 2019 23:24:20 +0000 (+0100) Subject: cgroups/cgfsng: rework cgfsng_{get,set}() X-Git-Tag: lxc-4.0.0~78^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a358028a7c1443a3bda816f950abaa156a8c758d;p=thirdparty%2Flxc.git cgroups/cgfsng: rework cgfsng_{get,set}() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 3cb2fe08d..30bf3093d 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2353,6 +2353,9 @@ __cgfsng_ops static int cgfsng_get(struct cgroup_ops *ops, const char *filename, struct hierarchy *h; int ret = -1; + if (!ops) + return ret_set_errno(-1, ENOENT); + controller = must_copy_string(filename); p = strchr(controller, '.'); if (p) @@ -2493,6 +2496,9 @@ __cgfsng_ops static int cgfsng_set(struct cgroup_ops *ops, struct hierarchy *h; int ret = -1; + if (!ops) + return ret_set_errno(-1, ENOENT); + controller = must_copy_string(key); p = strchr(controller, '.'); if (p)