]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups/cgfsng: rework cgfsng_{get,set}()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 23:24:20 +0000 (00:24 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 7 Dec 2019 23:28:48 +0000 (00:28 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 3cb2fe08de70f33caa017d6c1814d0c85279ba16..30bf3093d4f7699caf34bcddc7c30fa957a8deaf 100644 (file)
@@ -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)