From: Christian Brauner Date: Sat, 7 Dec 2019 23:41:36 +0000 (+0100) Subject: cgroups/cgfsng: rework cgfsng_nrtasks() X-Git-Tag: lxc-4.0.0~78^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1aae36a98fa51b66f09807e1aa0bdd470ce2f8da;p=thirdparty%2Flxc.git cgroups/cgfsng: rework cgfsng_nrtasks() Signed-off-by: Christian Brauner --- diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 0ce7258f0..f6e7a9df6 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -1933,8 +1933,11 @@ __cgfsng_ops static int cgfsng_nrtasks(struct cgroup_ops *ops) { __do_free char *path = NULL; + if (!ops) + return ret_set_errno(-1, ENOENT); + if (!ops->container_cgroup || !ops->hierarchies) - return -1; + return ret_set_errno(-1, EINVAL); path = must_make_path(ops->hierarchies[0]->container_full_path, NULL); return recursive_count_nrtasks(path);