]> 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>
Sun, 8 Dec 2019 01:37:31 +0000 (02:37 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 808a27045357840096cbe1a6a9fd7841c00362a8..46977cee8bd6c22793c02614397993357d03a927 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)